remove some unused mut decls

This commit is contained in:
Niko Matsakis 2013-04-30 16:35:01 -04:00
parent dc21daeeb8
commit f236b850c0
11 changed files with 16 additions and 18 deletions

View File

@ -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));

View File

@ -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(_) => {

View File

@ -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());

View File

@ -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()));

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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);

View File

@ -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;
}

View File

@ -3,6 +3,7 @@
fn main() {
let x = @mut 3;
let y: &mut int = x;
*x = 5;
let z = x;
*z = 5;
}

View File

@ -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() {