Skip to content

Commit 6abad4c

Browse files
authored
Rollup merge of #91882 - Patrick-Poitras:remove-in-band-lifetimes-from-rustc-typeck, r=jackh726
Remove `in_band_lifetimes` from `rustc_typeck` Joining in on the effort to remove the `in_band_lifetimes` features, as described in issue #91867.
2 parents 4e7497b + a586e7d commit 6abad4c

26 files changed

+72
-70
lines changed

compiler/rustc_typeck/src/astconv/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
9292
&self,
9393
span: Span,
9494
trait_def_id: DefId,
95-
trait_segment: &'a hir::PathSegment<'a>,
95+
trait_segment: &'_ hir::PathSegment<'_>,
9696
) {
9797
let trait_def = self.tcx().trait_def(trait_def_id);
9898

compiler/rustc_typeck/src/check/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
557557
}
558558
}
559559

560-
fn arms_contain_ref_bindings(arms: &'tcx [hir::Arm<'tcx>]) -> Option<hir::Mutability> {
560+
fn arms_contain_ref_bindings<'tcx>(arms: &'tcx [hir::Arm<'tcx>]) -> Option<hir::Mutability> {
561561
arms.iter().filter_map(|a| a.pat.contains_explicit_ref_binding()).max_by_key(|m| match *m {
562562
hir::Mutability::Mut => 1,
563563
hir::Mutability::Not => 0,

compiler/rustc_typeck/src/check/check.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ pub(super) fn check_opaque<'tcx>(
453453
/// Checks that an opaque type does not use `Self` or `T::Foo` projections that would result
454454
/// in "inheriting lifetimes".
455455
#[instrument(level = "debug", skip(tcx, span))]
456-
pub(super) fn check_opaque_for_inheriting_lifetimes(
456+
pub(super) fn check_opaque_for_inheriting_lifetimes<'tcx>(
457457
tcx: TyCtxt<'tcx>,
458458
def_id: LocalDefId,
459459
span: Span,
@@ -517,7 +517,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
517517
}
518518
}
519519

520-
impl Visitor<'tcx> for ProhibitOpaqueVisitor<'tcx> {
520+
impl<'tcx> Visitor<'tcx> for ProhibitOpaqueVisitor<'tcx> {
521521
type Map = rustc_middle::hir::map::Map<'tcx>;
522522

523523
fn nested_visit_map(&mut self) -> hir::intravisit::NestedVisitorMap<Self::Map> {
@@ -1512,7 +1512,7 @@ pub(super) use wfcheck::check_trait_item as check_trait_item_well_formed;
15121512

15131513
pub(super) use wfcheck::check_impl_item as check_impl_item_well_formed;
15141514

1515-
fn async_opaque_type_cycle_error(tcx: TyCtxt<'tcx>, span: Span) {
1515+
fn async_opaque_type_cycle_error(tcx: TyCtxt<'_>, span: Span) {
15161516
struct_span_err!(tcx.sess, span, E0733, "recursion in an `async fn` requires boxing")
15171517
.span_label(span, "recursive `async fn`")
15181518
.note("a recursive `async fn` must be rewritten to return a boxed `dyn Future`")
@@ -1530,7 +1530,7 @@ fn async_opaque_type_cycle_error(tcx: TyCtxt<'tcx>, span: Span) {
15301530
///
15311531
/// If all the return expressions evaluate to `!`, then we explain that the error will go away
15321532
/// after changing it. This can happen when a user uses `panic!()` or similar as a placeholder.
1533-
fn opaque_type_cycle_error(tcx: TyCtxt<'tcx>, def_id: LocalDefId, span: Span) {
1533+
fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) {
15341534
let mut err = struct_span_err!(tcx.sess, span, E0720, "cannot resolve opaque type");
15351535

15361536
let mut label = false;

compiler/rustc_typeck/src/check/coercion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn identity(_: Ty<'_>) -> Vec<Adjustment<'_>> {
102102
vec![]
103103
}
104104

105-
fn simple(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>> {
105+
fn simple<'tcx>(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>> {
106106
move |target| vec![Adjustment { kind, target }]
107107
}
108108

@@ -1694,7 +1694,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
16941694
err.help("you could instead create a new `enum` with a variant for each returned type");
16951695
}
16961696

1697-
fn is_return_ty_unsized(&self, fcx: &FnCtxt<'a, 'tcx>, blk_id: hir::HirId) -> bool {
1697+
fn is_return_ty_unsized<'a>(&self, fcx: &FnCtxt<'a, 'tcx>, blk_id: hir::HirId) -> bool {
16981698
if let Some((fn_decl, _)) = fcx.get_fn_decl(blk_id) {
16991699
if let hir::FnRetTy::Return(ty) = fn_decl.output {
17001700
let ty = <dyn AstConv<'_>>::ast_ty_to_ty(fcx, ty);

compiler/rustc_typeck/src/check/dropck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl<'tcx> SimpleEqRelation<'tcx> {
302302
}
303303
}
304304

305-
impl TypeRelation<'tcx> for SimpleEqRelation<'tcx> {
305+
impl<'tcx> TypeRelation<'tcx> for SimpleEqRelation<'tcx> {
306306
fn tcx(&self) -> TyCtxt<'tcx> {
307307
self.tcx
308308
}

compiler/rustc_typeck/src/check/inherited.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub struct InheritedBuilder<'tcx> {
7676
def_id: LocalDefId,
7777
}
7878

79-
impl Inherited<'_, 'tcx> {
79+
impl<'tcx> Inherited<'_, 'tcx> {
8080
pub fn build(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> InheritedBuilder<'tcx> {
8181
let hir_owner = tcx.hir().local_def_id_to_hir_id(def_id).owner;
8282

@@ -97,7 +97,7 @@ impl<'tcx> InheritedBuilder<'tcx> {
9797
}
9898
}
9999

100-
impl Inherited<'a, 'tcx> {
100+
impl<'a, 'tcx> Inherited<'a, 'tcx> {
101101
pub(super) fn new(infcx: InferCtxt<'a, 'tcx>, def_id: LocalDefId) -> Self {
102102
let tcx = infcx.tcx;
103103
let item_id = tcx.hir().local_def_id_to_hir_id(def_id);

compiler/rustc_typeck/src/check/method/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,7 @@ fn find_use_placement<'tcx>(tcx: TyCtxt<'tcx>, target_module: LocalDefId) -> (Op
19681968
(span, found_use)
19691969
}
19701970

1971-
fn print_disambiguation_help(
1971+
fn print_disambiguation_help<'tcx>(
19721972
item_name: Ident,
19731973
args: Option<&'tcx [hir::Expr<'tcx>]>,
19741974
err: &mut DiagnosticBuilder<'_>,

compiler/rustc_typeck/src/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ struct GeneratorTypes<'tcx> {
508508

509509
/// Given a `DefId` for an opaque type in return position, find its parent item's return
510510
/// expressions.
511-
fn get_owner_return_paths(
511+
fn get_owner_return_paths<'tcx>(
512512
tcx: TyCtxt<'tcx>,
513513
def_id: LocalDefId,
514514
) -> Option<(hir::HirId, ReturnsVisitor<'tcx>)> {
@@ -906,7 +906,7 @@ struct CheckItemTypesVisitor<'tcx> {
906906
tcx: TyCtxt<'tcx>,
907907
}
908908

909-
impl ItemLikeVisitor<'tcx> for CheckItemTypesVisitor<'tcx> {
909+
impl<'tcx> ItemLikeVisitor<'tcx> for CheckItemTypesVisitor<'tcx> {
910910
fn visit_item(&mut self, i: &'tcx hir::Item<'tcx>) {
911911
check_item_type(self.tcx, i);
912912
}

compiler/rustc_typeck/src/check/op.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ enum Op {
893893
}
894894

895895
/// Dereferences a single level of immutable referencing.
896-
fn deref_ty_if_possible(ty: Ty<'tcx>) -> Ty<'tcx> {
896+
fn deref_ty_if_possible<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
897897
match ty.kind() {
898898
ty::Ref(_, ty, hir::Mutability::Not) => ty,
899899
_ => ty,
@@ -1007,7 +1007,7 @@ impl<'tcx> TypeVisitor<'tcx> for TypeParamVisitor<'tcx> {
10071007

10081008
struct TypeParamEraser<'a, 'tcx>(&'a FnCtxt<'a, 'tcx>, Span);
10091009

1010-
impl TypeFolder<'tcx> for TypeParamEraser<'_, 'tcx> {
1010+
impl<'tcx> TypeFolder<'tcx> for TypeParamEraser<'_, 'tcx> {
10111011
fn tcx(&self) -> TyCtxt<'tcx> {
10121012
self.0.tcx
10131013
}

compiler/rustc_typeck/src/check/pat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
740740
}
741741
}
742742

743-
fn check_pat_path(
743+
fn check_pat_path<'b>(
744744
&self,
745745
pat: &Pat<'_>,
746746
path_resolution: (Res, Option<Ty<'tcx>>, &'b [hir::PathSegment<'b>]),
@@ -816,7 +816,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
816816
false
817817
}
818818

819-
fn emit_bad_pat_path(
819+
fn emit_bad_pat_path<'b>(
820820
&self,
821821
mut e: DiagnosticBuilder<'_>,
822822
pat_span: Span,

0 commit comments

Comments
 (0)