1
Fork 0

Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholk

rustc: Remove needless lifetimes
This commit is contained in:
Matthias Krüger 2022-12-24 00:31:41 +01:00 committed by GitHub
commit d23cb738d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 266 additions and 320 deletions

View file

@ -66,13 +66,13 @@ pub fn add_placeholder_note(err: &mut Diagnostic) {
/// with a suitably-freshened `ImplHeader` with those types
/// substituted. Otherwise, returns `None`.
#[instrument(skip(tcx, skip_leak_check), level = "debug")]
pub fn overlapping_impls<'tcx>(
tcx: TyCtxt<'tcx>,
pub fn overlapping_impls(
tcx: TyCtxt<'_>,
impl1_def_id: DefId,
impl2_def_id: DefId,
skip_leak_check: SkipLeakCheck,
overlap_mode: OverlapMode,
) -> Option<OverlapResult<'tcx>> {
) -> Option<OverlapResult<'_>> {
// Before doing expensive operations like entering an inference context, do
// a quick check via fast_reject to tell if the impl headers could possibly
// unify.
@ -283,7 +283,7 @@ fn implicit_negative<'cx, 'tcx>(
/// Given impl1 and impl2 check if both impls are never satisfied by a common type (including
/// where-clauses) If so, return true, they are disjoint and false otherwise.
fn negative_impl<'tcx>(tcx: TyCtxt<'tcx>, impl1_def_id: DefId, impl2_def_id: DefId) -> bool {
fn negative_impl(tcx: TyCtxt<'_>, impl1_def_id: DefId, impl2_def_id: DefId) -> bool {
debug!("negative_impl(impl1_def_id={:?}, impl2_def_id={:?})", impl1_def_id, impl2_def_id);
// Create an infcx, taking the predicates of impl1 as assumptions:

View file

@ -3472,7 +3472,7 @@ fn hint_missing_borrow<'tcx>(
let arg_spans = fn_decl.inputs.iter().map(|ty| ty.span);
fn get_deref_type_and_refs<'tcx>(mut ty: Ty<'tcx>) -> (Ty<'tcx>, usize) {
fn get_deref_type_and_refs(mut ty: Ty<'_>) -> (Ty<'_>, usize) {
let mut refs = 0;
while let ty::Ref(_, new_ty, _) = ty.kind() {

View file

@ -484,10 +484,7 @@ fn subst_and_check_impossible_predicates<'tcx>(
///
/// This only considers predicates that reference the impl's generics, and not
/// those that reference the method's generics.
fn is_impossible_method<'tcx>(
tcx: TyCtxt<'tcx>,
(impl_def_id, trait_item_def_id): (DefId, DefId),
) -> bool {
fn is_impossible_method(tcx: TyCtxt<'_>, (impl_def_id, trait_item_def_id): (DefId, DefId)) -> bool {
struct ReferencesOnlyParentGenerics<'tcx> {
tcx: TyCtxt<'tcx>,
generics: &'tcx ty::Generics,

View file

@ -34,7 +34,7 @@ impl<'a, 'tcx: 'a> InferCtxtExt<'a, 'tcx> for InferCtxt<'tcx> {
/// argument types are well-formed. This may imply certain relationships
/// between generic parameters. For example:
/// ```
/// fn foo<'a,T>(x: &'a T) {}
/// fn foo<T>(x: &T) {}
/// ```
/// can only be called with a `'a` and `T` such that `&'a T` is WF.
/// For `&'a T` to be WF, `T: 'a` must hold. So we can assume `T: 'a`.

View file

@ -191,7 +191,7 @@ fn dump_vtable_entries<'tcx>(
});
}
fn own_existential_vtable_entries<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId) -> &'tcx [DefId] {
fn own_existential_vtable_entries(tcx: TyCtxt<'_>, trait_def_id: DefId) -> &[DefId] {
let trait_methods = tcx
.associated_items(trait_def_id)
.in_definition_order()