From b35d601ab7dfe5500508a78fc9fe68db49c0e563 Mon Sep 17 00:00:00 2001 From: LingMan Date: Mon, 1 Feb 2021 18:16:07 +0100 Subject: [PATCH] Directly use `Option<&[T]>` instead of converting from `Option<&Vec>` later on --- compiler/rustc_resolve/src/late/lifetimes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index 95ac2a31dd321..6ddd38480c3de 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(); }