Skip to content

Commit 1ea756b

Browse files
author
Sylvan Bowdler
committed
Remove in_band_lifetimes from rustc_trait_selection
1 parent 7ca74ea commit 1ea756b

File tree

18 files changed

+63
-54
lines changed

18 files changed

+63
-54
lines changed

compiler/rustc_trait_selection/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(drain_filter)]
1717
#![feature(derive_default_enum)]
1818
#![feature(hash_drain_filter)]
19-
#![feature(in_band_lifetimes)]
2019
#![feature(iter_zip)]
2120
#![feature(let_else)]
2221
#![feature(never_type)]

compiler/rustc_trait_selection/src/opaque_types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct ReverseMapper<'tcx> {
9797
span: Span,
9898
}
9999

100-
impl ReverseMapper<'tcx> {
100+
impl<'tcx> ReverseMapper<'tcx> {
101101
fn new(
102102
tcx: TyCtxt<'tcx>,
103103
tainted_by_errors: bool,
@@ -134,7 +134,7 @@ impl ReverseMapper<'tcx> {
134134
}
135135
}
136136

137-
impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
137+
impl<'tcx> TypeFolder<'tcx> for ReverseMapper<'tcx> {
138138
fn tcx(&self) -> TyCtxt<'tcx> {
139139
self.tcx
140140
}
@@ -338,7 +338,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
338338
/// Requires that trait definitions have been processed so that we can
339339
/// elaborate predicates and walk supertraits.
340340
#[instrument(skip(tcx, predicates), level = "debug")]
341-
crate fn required_region_bounds(
341+
crate fn required_region_bounds<'tcx>(
342342
tcx: TyCtxt<'tcx>,
343343
erased_self_ty: Ty<'tcx>,
344344
predicates: impl Iterator<Item = ty::Predicate<'tcx>>,

compiler/rustc_trait_selection/src/traits/auto_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
219219
}
220220
}
221221

222-
impl AutoTraitFinder<'tcx> {
222+
impl<'tcx> AutoTraitFinder<'tcx> {
223223
/// The core logic responsible for computing the bounds for our synthesized impl.
224224
///
225225
/// To calculate the bounds, we call `SelectionContext.select` in a loop. Like

compiler/rustc_trait_selection/src/traits/chalk_fulfill.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct FulfillmentContext<'tcx> {
1616
relationships: FxHashMap<ty::TyVid, ty::FoundRelationships>,
1717
}
1818

19-
impl FulfillmentContext<'tcx> {
19+
impl FulfillmentContext<'_> {
2020
crate fn new() -> Self {
2121
FulfillmentContext {
2222
obligations: FxIndexSet::default(),
@@ -25,7 +25,7 @@ impl FulfillmentContext<'tcx> {
2525
}
2626
}
2727

28-
impl TraitEngine<'tcx> for FulfillmentContext<'tcx> {
28+
impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
2929
fn normalize_projection_type(
3030
&mut self,
3131
infcx: &InferCtxt<'_, 'tcx>,

compiler/rustc_trait_selection/src/traits/codegen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
107107
/// type inference variables that appear in `result` to be
108108
/// unified, and hence we need to process those obligations to get
109109
/// the complete picture of the type.
110-
fn drain_fulfillment_cx_or_panic<T>(
110+
fn drain_fulfillment_cx_or_panic<'tcx, T>(
111111
infcx: &InferCtxt<'_, 'tcx>,
112112
fulfill_cx: &mut FulfillmentContext<'tcx>,
113113
result: T,

compiler/rustc_trait_selection/src/traits/coherence.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,24 @@ fn overlap<'cx, 'tcx>(
154154
})
155155
}
156156

157-
fn overlap_within_probe(
157+
fn overlap_within_probe<'cx, 'tcx>(
158158
selcx: &mut SelectionContext<'cx, 'tcx>,
159159
skip_leak_check: SkipLeakCheck,
160160
a_def_id: DefId,
161161
b_def_id: DefId,
162162
snapshot: &CombinedSnapshot<'_, 'tcx>,
163163
) -> Option<OverlapResult<'tcx>> {
164-
fn loose_check(selcx: &mut SelectionContext<'cx, 'tcx>, o: &PredicateObligation<'tcx>) -> bool {
164+
fn loose_check<'cx, 'tcx>(
165+
selcx: &mut SelectionContext<'cx, 'tcx>,
166+
o: &PredicateObligation<'tcx>,
167+
) -> bool {
165168
!selcx.predicate_may_hold_fatal(o)
166169
}
167170

168-
fn strict_check(selcx: &SelectionContext<'cx, 'tcx>, o: &PredicateObligation<'tcx>) -> bool {
171+
fn strict_check<'cx, 'tcx>(
172+
selcx: &SelectionContext<'cx, 'tcx>,
173+
o: &PredicateObligation<'tcx>,
174+
) -> bool {
169175
let infcx = selcx.infcx();
170176
let tcx = infcx.tcx;
171177
o.flip_polarity(tcx)
@@ -518,7 +524,11 @@ fn orphan_check_trait_ref<'tcx>(
518524
/// - for `Foo<u32>`, where `Foo` is a local type, this returns `[]`.
519525
/// - `&mut u32` returns `[u32]`, as `&mut` is a fundamental type, similar to `Box`.
520526
/// - `Box<Foo<u32>>` returns `[]`, as `Box` is a fundamental type and `Foo` is local.
521-
fn contained_non_local_types(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, in_crate: InCrate) -> Vec<Ty<'tcx>> {
527+
fn contained_non_local_types<'tcx>(
528+
tcx: TyCtxt<'tcx>,
529+
ty: Ty<'tcx>,
530+
in_crate: InCrate,
531+
) -> Vec<Ty<'tcx>> {
522532
if ty_is_local_constructor(ty, in_crate) {
523533
Vec::new()
524534
} else {
@@ -534,7 +544,7 @@ fn contained_non_local_types(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, in_crate: InCrate)
534544
/// For `#[fundamental]` ADTs and `&T` / `&mut T`, returns `Some` with the
535545
/// type parameters of the ADT, or `T`, respectively. For non-fundamental
536546
/// types, returns `None`.
537-
fn fundamental_ty_inner_tys(
547+
fn fundamental_ty_inner_tys<'tcx>(
538548
tcx: TyCtxt<'tcx>,
539549
ty: Ty<'tcx>,
540550
) -> Option<impl Iterator<Item = Ty<'tcx>>> {

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
10621062
}
10631063
}
10641064

1065-
trait InferCtxtPrivExt<'tcx> {
1065+
trait InferCtxtPrivExt<'hir, 'tcx> {
10661066
// returns if `cond` not occurring implies that `error` does not occur - i.e., that
10671067
// `error` occurring implies that `cond` occurs.
10681068
fn error_implies(&self, cond: ty::Predicate<'tcx>, error: ty::Predicate<'tcx>) -> bool;
@@ -1173,7 +1173,7 @@ trait InferCtxtPrivExt<'tcx> {
11731173
) -> bool;
11741174
}
11751175

1176-
impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1176+
impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
11771177
// returns if `cond` not occurring implies that `error` does not occur - i.e., that
11781178
// `error` occurring implies that `cond` occurs.
11791179
fn error_implies(&self, cond: ty::Predicate<'tcx>, error: ty::Predicate<'tcx>) -> bool {
@@ -2023,7 +2023,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
20232023
self.maybe_suggest_unsized_generics(err, span, node);
20242024
}
20252025

2026-
fn maybe_suggest_unsized_generics(
2026+
fn maybe_suggest_unsized_generics<'hir>(
20272027
&self,
20282028
err: &mut DiagnosticBuilder<'tcx>,
20292029
span: Span,
@@ -2090,7 +2090,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
20902090
);
20912091
}
20922092

2093-
fn maybe_indirection_for_unsized(
2093+
fn maybe_indirection_for_unsized<'hir>(
20942094
&self,
20952095
err: &mut DiagnosticBuilder<'tcx>,
20962096
item: &'hir Item<'hir>,
@@ -2204,7 +2204,7 @@ impl<'v> Visitor<'v> for FindTypeParam {
22042204
}
22052205

22062206
pub fn recursive_type_with_infinite_size_error(
2207-
tcx: TyCtxt<'tcx>,
2207+
tcx: TyCtxt<'_>,
22082208
type_def_id: DefId,
22092209
spans: Vec<Span>,
22102210
) {

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ fn predicate_constraint(generics: &hir::Generics<'_>, pred: String) -> (Span, St
192192
/// Type parameter needs more bounds. The trivial case is `T` `where T: Bound`, but
193193
/// it can also be an `impl Trait` param that needs to be decomposed to a type
194194
/// param for cleaner code.
195-
fn suggest_restriction(
195+
fn suggest_restriction<'tcx>(
196196
tcx: TyCtxt<'tcx>,
197197
generics: &hir::Generics<'tcx>,
198198
msg: &str,

compiler/rustc_trait_selection/src/traits/fulfill.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ struct FulfillProcessor<'a, 'b, 'tcx> {
252252
register_region_obligations: bool,
253253
}
254254

255-
fn mk_pending(os: Vec<PredicateObligation<'tcx>>) -> Vec<PendingPredicateObligation<'tcx>> {
255+
fn mk_pending(os: Vec<PredicateObligation<'_>>) -> Vec<PendingPredicateObligation<'_>> {
256256
os.into_iter()
257257
.map(|o| PendingPredicateObligation { obligation: o, stalled_on: vec![] })
258258
.collect()

compiler/rustc_trait_selection/src/traits/misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub enum CopyImplementationError<'tcx> {
1616
HasDestructor,
1717
}
1818

19-
pub fn can_type_implement_copy(
19+
pub fn can_type_implement_copy<'tcx>(
2020
tcx: TyCtxt<'tcx>,
2121
param_env: ty::ParamEnv<'tcx>,
2222
self_type: Ty<'tcx>,

0 commit comments

Comments
 (0)