rustc: Remove needless lifetimes

This commit is contained in:
Jeremy Stucki 2022-12-20 22:10:40 +01:00
parent 65bd2a6a73
commit 3dde32ca97
No known key found for this signature in database
GPG key ID: D2A1E19158A33812
109 changed files with 266 additions and 320 deletions

View file

@ -533,10 +533,10 @@ fn make_code_region(
}
}
fn fn_sig_and_body<'tcx>(
tcx: TyCtxt<'tcx>,
fn fn_sig_and_body(
tcx: TyCtxt<'_>,
def_id: DefId,
) -> (Option<&'tcx rustc_hir::FnSig<'tcx>>, &'tcx rustc_hir::Body<'tcx>) {
) -> (Option<&rustc_hir::FnSig<'_>>, &rustc_hir::Body<'_>) {
// FIXME(#79625): Consider improving MIR to provide the information needed, to avoid going back
// to HIR for it.
let hir_node = tcx.hir().get_if_local(def_id).expect("expected DefId is local");

View file

@ -136,7 +136,7 @@ fn coverageinfo<'tcx>(tcx: TyCtxt<'tcx>, instance_def: ty::InstanceDef<'tcx>) ->
coverage_visitor.info
}
fn covered_code_regions<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Vec<&'tcx CodeRegion> {
fn covered_code_regions(tcx: TyCtxt<'_>, def_id: DefId) -> Vec<&CodeRegion> {
let body = mir_body(tcx, def_id);
body.basic_blocks
.iter()
@ -163,7 +163,7 @@ fn is_inlined(body: &Body<'_>, statement: &Statement<'_>) -> bool {
/// This function ensures we obtain the correct MIR for the given item irrespective of
/// whether that means const mir or runtime mir. For `const fn` this opts for runtime
/// mir.
fn mir_body<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &'tcx mir::Body<'tcx> {
fn mir_body(tcx: TyCtxt<'_>, def_id: DefId) -> &mir::Body<'_> {
let id = ty::WithOptConstParam::unknown(def_id);
let def = ty::InstanceDef::Item(id);
tcx.instance_mir(def)

View file

@ -169,7 +169,7 @@ impl<'tcx> MockBlocks<'tcx> {
}
}
fn debug_basic_blocks<'tcx>(mir_body: &Body<'tcx>) -> String {
fn debug_basic_blocks(mir_body: &Body) -> String {
format!(
"{:?}",
mir_body