Skip to content

Commit c389d0b

Browse files
committed
rustc: remove unused 'mut' variables
1 parent fd97cac commit c389d0b

File tree

17 files changed

+36
-34
lines changed

17 files changed

+36
-34
lines changed

src/librustc/back/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ pub mod write {
273273
let LLVMOptDefault = 2 as c_int; // -O2, -Os
274274
let LLVMOptAggressive = 3 as c_int; // -O3
275275

276-
let mut CodeGenOptLevel = match opts.optimize {
276+
let CodeGenOptLevel = match opts.optimize {
277277
session::No => LLVMOptNone,
278278
session::Less => LLVMOptLess,
279279
session::Default => LLVMOptDefault,
@@ -294,7 +294,7 @@ pub mod write {
294294
return;
295295
}
296296

297-
let mut FileType;
297+
let FileType;
298298
if output_type == output_type_object ||
299299
output_type == output_type_exe {
300300
FileType = lib::llvm::ObjectFile;
@@ -820,7 +820,7 @@ pub fn link_binary(sess: Session,
820820
cc_args.push(output.to_str());
821821
cc_args.push(obj_filename.to_str());
822822
823-
let mut lib_cmd;
823+
let lib_cmd;
824824
let os = sess.targ_cfg.os;
825825
if os == session::os_macos {
826826
lib_cmd = ~"-dynamiclib";

src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ pub fn compile_upto(sess: Session, cfg: ast::crate_cfg,
349349
outputs: Option<@OutputFilenames>)
350350
-> (@ast::crate, Option<ty::ctxt>) {
351351
let time_passes = sess.time_passes();
352-
let mut crate = time(time_passes, ~"parsing",
352+
let crate = time(time_passes, ~"parsing",
353353
|| parse_input(sess, copy cfg, input) );
354354
if upto == cu_parse { return (crate, None); }
355355

src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ pub static metadata_encoding_version : &'static [u8] =
13411341
13421342
pub fn encode_metadata(parms: EncodeParams, crate: &crate) -> ~[u8] {
13431343
let wr = @io::BytesWriter();
1344-
let mut stats = Stats {
1344+
let stats = Stats {
13451345
inline_bytes: 0,
13461346
attr_bytes: 0,
13471347
dep_bytes: 0,

src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub impl GatherLoanCtxt {
305305
let mcx = &mem_categorization_ctxt {
306306
tcx: self.tcx(),
307307
method_map: self.bccx.method_map};
308-
let mut cmt = mcx.cat_expr_autoderefd(expr, autoderefs);
308+
let cmt = mcx.cat_expr_autoderefd(expr, autoderefs);
309309
debug!("after autoderef, cmt=%s", self.bccx.cmt_to_repr(cmt));
310310

311311
match autoref.kind {

src/librustc/middle/borrowck/loan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use middle::mem_categorization::{cat_arg, cat_binding, cat_discr, cat_comp};
5151
use middle::mem_categorization::{cat_deref, cat_discr, cat_local, cat_self};
5252
use middle::mem_categorization::{cat_special, cat_stack_upvar, cmt};
5353
use middle::mem_categorization::{comp_field, comp_index, comp_variant};
54-
use middle::mem_categorization::{gc_ptr, region_ptr, lp_local, lp_arg};
54+
use middle::mem_categorization::{gc_ptr, region_ptr};
5555
use middle::ty;
5656
use util::common::indenter;
5757

src/librustc/middle/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
481481
left_ty: ty::t)
482482
-> Option<~[@pat]> {
483483
// Sad, but I can't get rid of this easily
484-
let mut r0 = copy *raw_pat(r[0]);
484+
let r0 = copy *raw_pat(r[0]);
485485
match r0 {
486486
pat{id: pat_id, node: n, span: pat_span} =>
487487
match n {

src/librustc/middle/resolve.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ pub impl Resolver {
960960
// child name directly. Otherwise, we create or reuse an anonymous
961961
// module and add the child to that.
962962
963-
let mut module_;
963+
let module_;
964964
match reduced_graph_parent {
965965
ModuleReducedGraphParent(parent_module) => {
966966
module_ = parent_module;
@@ -1527,7 +1527,7 @@ pub impl Resolver {
15271527
block: &blk,
15281528
parent: ReducedGraphParent,
15291529
visitor: vt<ReducedGraphParent>) {
1530-
let mut new_parent;
1530+
let new_parent;
15311531
if self.block_needs_anonymous_module(block) {
15321532
let block_id = block.node.id;
15331533
@@ -2427,7 +2427,7 @@ pub impl Resolver {
24272427

24282428
let merge_import_resolution = |ident,
24292429
name_bindings: @mut NameBindings| {
2430-
let mut dest_import_resolution;
2430+
let dest_import_resolution;
24312431
match module_.import_resolutions.find(ident) {
24322432
None => {
24332433
// Create a new import resolution from this child.
@@ -2583,8 +2583,8 @@ pub impl Resolver {
25832583
let module_prefix_result = self.resolve_module_prefix(module_,
25842584
module_path);
25852585

2586-
let mut search_module;
2587-
let mut start_index;
2586+
let search_module;
2587+
let start_index;
25882588
match module_prefix_result {
25892589
Failed => {
25902590
self.session.span_err(span, ~"unresolved name");
@@ -3221,7 +3221,7 @@ pub impl Resolver {
32213221
allow_capturing_self: AllowCapturingSelfFlag)
32223222
-> Option<def_like> {
32233223
let mut def;
3224-
let mut is_ty_param;
3224+
let is_ty_param;
32253225

32263226
match def_like {
32273227
dl_def(d @ def_local(*)) | dl_def(d @ def_upvar(*)) |
@@ -4530,7 +4530,7 @@ pub impl Resolver {
45304530
-> Option<def> {
45314531
let module_path_idents = self.intern_module_part_of_path(path);
45324532

4533-
let mut containing_module;
4533+
let containing_module;
45344534
match self.resolve_module_path_for_import(self.current_module,
45354535
module_path_idents,
45364536
UseLexicalScope,
@@ -4578,7 +4578,7 @@ pub impl Resolver {
45784578
45794579
let root_module = self.graph_root.get_module();
45804580
4581-
let mut containing_module;
4581+
let containing_module;
45824582
match self.resolve_module_path_from_root(root_module,
45834583
module_path_idents,
45844584
0,
@@ -4622,7 +4622,7 @@ pub impl Resolver {
46224622
span: span)
46234623
-> Option<def> {
46244624
// Check the local set of ribs.
4625-
let mut search_result;
4625+
let search_result;
46264626
match namespace {
46274627
ValueNS => {
46284628
search_result = self.search_ribs(&mut self.value_ribs, ident,

src/librustc/middle/trans/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub enum opt_result {
248248
pub fn trans_opt(bcx: block, o: &Opt) -> opt_result {
249249
let _icx = bcx.insn_ctxt("match::trans_opt");
250250
let ccx = bcx.ccx();
251-
let mut bcx = bcx;
251+
let bcx = bcx;
252252
match *o {
253253
lit(ExprLit(lit_expr)) => {
254254
let datumblock = expr::trans_to_datum(bcx, lit_expr);

src/librustc/middle/trans/callee.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ pub fn trans_fn_ref_with_vtables(
292292
}
293293

294294
// Find the actual function pointer.
295-
let mut val = {
295+
let val = {
296296
if def_id.crate == ast::local_crate {
297297
// Internal reference.
298298
get_item_val(ccx, def_id.node)
@@ -415,7 +415,7 @@ pub fn trans_lang_call_with_type_params(bcx: block,
415415
type_params,
416416
None,
417417
fty);
418-
let mut llfnty = type_of::type_of(callee.bcx.ccx(),
418+
let llfnty = type_of::type_of(callee.bcx.ccx(),
419419
substituted);
420420
new_llval = PointerCast(callee.bcx, fn_data.llfn, llfnty);
421421
}
@@ -712,7 +712,7 @@ pub fn trans_arg_expr(bcx: block,
712712
}
713713
};
714714
let mut arg_datum = arg_datumblock.datum;
715-
let mut bcx = arg_datumblock.bcx;
715+
let bcx = arg_datumblock.bcx;
716716

717717
debug!(" arg datum: %s", arg_datum.to_str(bcx.ccx()));
718718

src/librustc/middle/trans/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ pub fn build_closure(bcx0: block,
261261
include_ret_handle: Option<ValueRef>) -> ClosureResult {
262262
let _icx = bcx0.insn_ctxt("closure::build_closure");
263263
// If we need to, package up the iterator body to call
264-
let mut bcx = bcx0;;
264+
let bcx = bcx0;;
265265
let ccx = bcx.ccx(), tcx = ccx.tcx;
266266

267267
// Package up the captured upvars

0 commit comments

Comments
 (0)