diff options
| author | LingMan <LingMan@users.noreply.github.com> | 2021-02-01 18:16:07 +0100 |
|---|---|---|
| committer | LingMan <LingMan@users.noreply.github.com> | 2021-02-01 19:51:24 +0100 |
| commit | b35d601ab7dfe5500508a78fc9fe68db49c0e563 (patch) | |
| tree | f27652c4638169b2b92ec31dd5e5b3a851ea9203 | |
| parent | e0d9f793990d20f8f640097e28556886ba5362f0 (diff) | |
| download | rust-b35d601ab7dfe5500508a78fc9fe68db49c0e563.tar.gz rust-b35d601ab7dfe5500508a78fc9fe68db49c0e563.zip | |
Directly use `Option<&[T]>` instead of converting from `Option<&Vec<T>>` later on
| -rw-r--r-- | compiler/rustc_resolve/src/late/lifetimes.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index 95ac2a31dd3..6ddd38480c3 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -2422,7 +2422,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { _ => break, } } - break Some(e); + break Some(&e[..]); } Elide::Forbid => break None, }; @@ -2452,7 +2452,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { lifetime_refs.len(), &lifetime_names, lifetime_spans, - error.map(|p| &p[..]).unwrap_or(&[]), + error.unwrap_or(&[]), ); err.emit(); } |
