summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-30 10:19:38 +0000
committerbors <bors@rust-lang.org>2018-07-30 10:19:38 +0000
commite4378412ecfc2a4ff5dfd65fef53fa6be691f689 (patch)
tree2da55959070dea0d160b61dc09c276593434b767 /src/librustc
parent5ed2b5120bd875a7eb9fd8545d86eb1de1e41bce (diff)
parent18d5f821480803811f3f7ef866ef0ef8ae9bf9c1 (diff)
downloadrust-e4378412ecfc2a4ff5dfd65fef53fa6be691f689.tar.gz
rust-e4378412ecfc2a4ff5dfd65fef53fa6be691f689.zip
Auto merge of #52830 - matthewjasper:bootstrap-prep, r=matthewjasper
[NLL] Fix some things for bootstrap

Some changes that are required when bootstrapping rustc with NLL enabled.

* Remove a bunch of unused `mut`s that aren't needed, but the existing lint doesn't catch.
* Rewrite a function call to satisfy NLL borrowck. Note that the borrow is two-phase, but gets activated immediately by an unsizing coercion.

cc #51823
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/hir/lowering.rs2
-rw-r--r--src/librustc/traits/error_reporting.rs2
-rw-r--r--src/librustc/util/ppaux.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index 7e2c5d03d6b..63755bcea5e 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -2814,7 +2814,7 @@ impl<'a> LoweringContext<'a> {
                 let mut defs = self.expect_full_def_from_use(id);
                 // we want to return *something* from this function, so hang onto the first item
                 // for later
-                let mut ret_def = defs.next().unwrap_or(Def::Err);
+                let ret_def = defs.next().unwrap_or(Def::Err);
 
                 for (def, &new_node_id) in defs.zip([id1, id2].iter()) {
                     let vis = vis.clone();
diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs
index b99c630edfc..c04785aac20 100644
--- a/src/librustc/traits/error_reporting.rs
+++ b/src/librustc/traits/error_reporting.rs
@@ -1054,7 +1054,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
             // found arguments is empty (assume the user just wants to ignore args in this case).
             // For example, if `expected_args_length` is 2, suggest `|_, _|`.
             if found_args.is_empty() && is_closure {
-                let mut underscores = "_".repeat(expected_args.len())
+                let underscores = "_".repeat(expected_args.len())
                                       .split("")
                                       .filter(|s| !s.is_empty())
                                       .collect::<Vec<_>>()
diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs
index 15b5edaa3d5..bb54e183604 100644
--- a/src/librustc/util/ppaux.rs
+++ b/src/librustc/util/ppaux.rs
@@ -354,7 +354,7 @@ impl PrintContext {
                 };
                 if has_default {
                     if let Some(substs) = tcx.lift(&substs) {
-                        let mut types = substs.types().rev().skip(child_types);
+                        let types = substs.types().rev().skip(child_types);
                         for ((def_id, has_default), actual) in type_params.zip(types) {
                             if !has_default {
                                 break;