diff options
| author | LingMan <LingMan@users.noreply.github.com> | 2021-01-20 02:48:48 +0100 |
|---|---|---|
| committer | LingMan <LingMan@users.noreply.github.com> | 2021-02-01 15:37:46 +0100 |
| commit | 8e34522309cb6907da0a6ae593894f2b1d847ee6 (patch) | |
| tree | e9ba5965c82af2fe1b83bccb868b1a8741da0ef3 | |
| parent | e0d9f793990d20f8f640097e28556886ba5362f0 (diff) | |
| download | rust-8e34522309cb6907da0a6ae593894f2b1d847ee6.tar.gz rust-8e34522309cb6907da0a6ae593894f2b1d847ee6.zip | |
Remove unneeded `mut` variable
`arg_elide` gets initialized, immediately cloned, and only written to after that. The last reading access was removed back in https://github.com/rust-lang/rust/commit/7704762604a8bf4504a06e8c9713bc7c158d362a
| -rw-r--r-- | compiler/rustc_resolve/src/late/lifetimes.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index 95ac2a31dd3..004c06029ff 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -2083,18 +2083,11 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { output: Option<&'tcx hir::Ty<'tcx>>, ) { debug!("visit_fn_like_elision: enter"); - let mut arg_elide = Elide::FreshLateAnon(Cell::new(0)); - let arg_scope = Scope::Elision { elide: arg_elide.clone(), s: self.scope }; + let arg_scope = Scope::Elision { elide: Elide::FreshLateAnon(Cell::new(0)), s: self.scope }; self.with(arg_scope, |_, this| { for input in inputs { this.visit_ty(input); } - match *this.scope { - Scope::Elision { ref elide, .. } => { - arg_elide = elide.clone(); - } - _ => bug!(), - } }); let output = match output { |
