Rollup merge of #81636 - LingMan:slice_not_vec, r=petrochenkov

Directly use `Option<&[T]>` instead of converting from `Option<&Vec<T>>` later on

```@rustbot``` modify labels +C-cleanup +T-compiler
This commit is contained in:
Jack Huey 2021-02-02 16:01:45 -05:00 committed by GitHub
commit 86e23cc9f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2415,7 +2415,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
_ => break,
}
}
break Some(e);
break Some(&e[..]);
}
Elide::Forbid => break None,
};
@ -2445,7 +2445,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();
}