remove some unused mut decls
This commit is contained in:
parent
dc21daeeb8
commit
f236b850c0
@ -385,7 +385,7 @@ pub fn pow_with_uint<T:NumCast+One+Zero+Copy+Quot<T,T>+Mul<T,T>>(
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn test_num<T:Num + NumCast>(ten: T, two: T) {
|
||||
pub fn test_num<T:Num + NumCast>(ten: T, two: T) {
|
||||
assert_eq!(ten.add(&two), cast(12));
|
||||
assert_eq!(ten.sub(&two), cast(8));
|
||||
assert_eq!(ten.mul(&two), cast(20));
|
||||
|
@ -5267,7 +5267,7 @@ pub impl Resolver {
|
||||
|
||||
debug!("Import resolutions:");
|
||||
for module_.import_resolutions.each |name, import_resolution| {
|
||||
let mut value_repr;
|
||||
let value_repr;
|
||||
match import_resolution.target_for_namespace(ValueNS) {
|
||||
None => { value_repr = ~""; }
|
||||
Some(_) => {
|
||||
@ -5276,7 +5276,7 @@ pub impl Resolver {
|
||||
}
|
||||
}
|
||||
|
||||
let mut type_repr;
|
||||
let type_repr;
|
||||
match import_resolution.target_for_namespace(TypeNS) {
|
||||
None => { type_repr = ~""; }
|
||||
Some(_) => {
|
||||
|
@ -2366,7 +2366,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
|
||||
// Call main.
|
||||
let lloutputarg = C_null(T_ptr(T_i8()));
|
||||
let llenvarg = unsafe { llvm::LLVMGetParam(llfdecl, 1 as c_uint) };
|
||||
let mut args = ~[lloutputarg, llenvarg];
|
||||
let args = ~[lloutputarg, llenvarg];
|
||||
let llresult = Call(bcx, main_llfn, args);
|
||||
Store(bcx, llresult, fcx.llretptr.get());
|
||||
|
||||
|
@ -722,7 +722,7 @@ pub fn trans_arg_expr(bcx: block,
|
||||
}
|
||||
}
|
||||
};
|
||||
let mut arg_datum = arg_datumblock.datum;
|
||||
let arg_datum = arg_datumblock.datum;
|
||||
let bcx = arg_datumblock.bcx;
|
||||
|
||||
debug!(" arg datum: %s", arg_datum.to_str(bcx.ccx()));
|
||||
|
@ -563,7 +563,6 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
|
||||
|
||||
fn trans_rvalue_dps_unadjusted(bcx: block, expr: @ast::expr,
|
||||
dest: Dest) -> block {
|
||||
let mut bcx = bcx;
|
||||
let _icx = bcx.insn_ctxt("trans_rvalue_dps_unadjusted");
|
||||
let tcx = bcx.tcx();
|
||||
|
||||
@ -1408,7 +1407,6 @@ fn trans_eager_binop(bcx: block,
|
||||
lhs_datum: &Datum,
|
||||
rhs_datum: &Datum)
|
||||
-> DatumBlock {
|
||||
let mut bcx = bcx;
|
||||
let _icx = bcx.insn_ctxt("trans_eager_binop");
|
||||
|
||||
let lhs = lhs_datum.to_appropriate_llval(bcx);
|
||||
|
@ -120,7 +120,7 @@ pub fn lookup(
|
||||
expr: @ast::expr, // The expression `a.b(...)`.
|
||||
self_expr: @ast::expr, // The expression `a`.
|
||||
callee_id: node_id, /* Where to store `a.b`'s type,
|
||||
* also the scope of the call */
|
||||
* also the scope of the call */
|
||||
m_name: ast::ident, // The ident `b`.
|
||||
self_ty: ty::t, // The type of `a`.
|
||||
supplied_tps: &[ty::t], // The list of types X, Y, ... .
|
||||
@ -128,7 +128,7 @@ pub fn lookup(
|
||||
check_traits: CheckTraitsFlag, // Whether we check traits only.
|
||||
autoderef_receiver: AutoderefReceiverFlag)
|
||||
-> Option<method_map_entry> {
|
||||
let mut impl_dups = @mut HashSet::new();
|
||||
let impl_dups = @mut HashSet::new();
|
||||
let lcx = LookupContext {
|
||||
fcx: fcx,
|
||||
expr: expr,
|
||||
|
@ -1684,7 +1684,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
|
||||
};
|
||||
|
||||
// construct the function type
|
||||
let mut fn_ty = astconv::ty_of_closure(fcx,
|
||||
let fn_ty = astconv::ty_of_closure(fcx,
|
||||
fcx,
|
||||
sigil,
|
||||
purity,
|
||||
@ -1695,7 +1695,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
|
||||
&opt_vec::Empty,
|
||||
expr.span);
|
||||
|
||||
let mut fty_sig;
|
||||
let fty_sig;
|
||||
let fty = if error_happened {
|
||||
fty_sig = FnSig {
|
||||
bound_lifetime_names: opt_vec::Empty,
|
||||
|
@ -871,7 +871,7 @@ pub mod guarantor {
|
||||
let tcx = rcx.tcx();
|
||||
debug!("guarantor::for_by_ref(expr=%s, callee_scope=%?)",
|
||||
expr.repr(tcx), callee_scope);
|
||||
let mut expr_cat = categorize(rcx, expr);
|
||||
let expr_cat = categorize(rcx, expr);
|
||||
debug!("guarantor::for_by_ref(expr=%?, callee_scope=%?) category=%?",
|
||||
expr.id, callee_scope, expr_cat);
|
||||
let minimum_lifetime = ty::re_scope(callee_scope);
|
||||
|
@ -7,5 +7,6 @@ struct S {
|
||||
fn main() {
|
||||
let x = @mut S { x: 3 };
|
||||
let y: &S = x;
|
||||
x.x = 5;
|
||||
let z = x;
|
||||
z.x = 5;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
fn main() {
|
||||
let x = @mut 3;
|
||||
let y: &mut int = x;
|
||||
*x = 5;
|
||||
let z = x;
|
||||
*z = 5;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
// error-pattern:borrowed
|
||||
|
||||
fn f(x: &int, y: @mut int) {
|
||||
unsafe {
|
||||
*y = 2;
|
||||
}
|
||||
fn f(_x: &int, y: @mut int) {
|
||||
*y = 2;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user