Skip to content

Commit 578403a

Browse files
committed
made ./x.py check happy
1 parent 7ca74ea commit 578403a

18 files changed

+48
-49
lines changed

compiler/rustc_trait_selection/src/lib.rs

-1
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

+3-3
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

+1-1
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

+2-2
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<'tcx> FulfillmentContext<'tcx> {
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

+1-1
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,18 @@ 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>(selcx: &mut SelectionContext<'cx, 'tcx>, o: &PredicateObligation<'tcx>) -> bool {
165165
!selcx.predicate_may_hold_fatal(o)
166166
}
167167

168-
fn strict_check(selcx: &SelectionContext<'cx, 'tcx>, o: &PredicateObligation<'tcx>) -> bool {
168+
fn strict_check<'cx, 'tcx>(selcx: &SelectionContext<'cx, 'tcx>, o: &PredicateObligation<'tcx>) -> bool {
169169
let infcx = selcx.infcx();
170170
let tcx = infcx.tcx;
171171
o.flip_polarity(tcx)
@@ -518,7 +518,7 @@ fn orphan_check_trait_ref<'tcx>(
518518
/// - for `Foo<u32>`, where `Foo` is a local type, this returns `[]`.
519519
/// - `&mut u32` returns `[u32]`, as `&mut` is a fundamental type, similar to `Box`.
520520
/// - `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>> {
521+
fn contained_non_local_types<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, in_crate: InCrate) -> Vec<Ty<'tcx>> {
522522
if ty_is_local_constructor(ty, in_crate) {
523523
Vec::new()
524524
} else {
@@ -534,7 +534,7 @@ fn contained_non_local_types(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, in_crate: InCrate)
534534
/// For `#[fundamental]` ADTs and `&T` / `&mut T`, returns `Some` with the
535535
/// type parameters of the ADT, or `T`, respectively. For non-fundamental
536536
/// types, returns `None`.
537-
fn fundamental_ty_inner_tys(
537+
fn fundamental_ty_inner_tys<'tcx>(
538538
tcx: TyCtxt<'tcx>,
539539
ty: Ty<'tcx>,
540540
) -> Option<impl Iterator<Item = Ty<'tcx>>> {

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

+6-6
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 {
@@ -2027,7 +2027,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
20272027
&self,
20282028
err: &mut DiagnosticBuilder<'tcx>,
20292029
span: Span,
2030-
node: Node<'hir>,
2030+
node: Node<'a>,
20312031
) {
20322032
let generics = match node.generics() {
20332033
Some(generics) => generics,
@@ -2093,8 +2093,8 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
20932093
fn maybe_indirection_for_unsized(
20942094
&self,
20952095
err: &mut DiagnosticBuilder<'tcx>,
2096-
item: &'hir Item<'hir>,
2097-
param: &'hir GenericParam<'hir>,
2096+
item: &'a Item<'a>,
2097+
param: &'a GenericParam<'a>,
20982098
) -> bool {
20992099
// Suggesting `T: ?Sized` is only valid in an ADT if `T` is only used in a
21002100
// borrow. `struct S<'a, T: ?Sized>(&'a T);` is valid, `struct S<T: ?Sized>(T);`
@@ -2203,7 +2203,7 @@ impl<'v> Visitor<'v> for FindTypeParam {
22032203
}
22042204
}
22052205

2206-
pub fn recursive_type_with_infinite_size_error(
2206+
pub fn recursive_type_with_infinite_size_error<'tcx>(
22072207
tcx: TyCtxt<'tcx>,
22082208
type_def_id: DefId,
22092209
spans: Vec<Span>,

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

+1-1
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

+1-1
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<'tcx>(os: Vec<PredicateObligation<'tcx>>) -> Vec<PendingPredicateObligation<'tcx>> {
256256
os.into_iter()
257257
.map(|o| PendingPredicateObligation { obligation: o, stalled_on: vec![] })
258258
.collect()

compiler/rustc_trait_selection/src/traits/misc.rs

+1-1
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>,

compiler/rustc_trait_selection/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ fn vtable_trait_first_method_offset<'tcx>(
801801
}
802802

803803
/// Find slot offset for trait vptr within vtable entries of another trait
804-
pub fn vtable_trait_upcasting_coercion_new_vptr_slot(
804+
pub fn vtable_trait_upcasting_coercion_new_vptr_slot<'tcx>(
805805
tcx: TyCtxt<'tcx>,
806806
key: (
807807
Ty<'tcx>, // trait object type whose trait owning vtable

compiler/rustc_trait_selection/src/traits/object_safety.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub fn astconv_object_safety_violations(
5050
violations
5151
}
5252

53-
fn object_safety_violations(
53+
fn object_safety_violations<'tcx>(
5454
tcx: TyCtxt<'tcx>,
5555
trait_def_id: DefId,
5656
) -> &'tcx [ObjectSafetyViolation] {
@@ -272,7 +272,7 @@ fn bounds_reference_self(tcx: TyCtxt<'_>, trait_def_id: DefId) -> SmallVec<[Span
272272
.collect()
273273
}
274274

275-
fn predicate_references_self(
275+
fn predicate_references_self<'tcx>(
276276
tcx: TyCtxt<'tcx>,
277277
(predicate, sp): (ty::Predicate<'tcx>, Span),
278278
) -> Option<Span> {

compiler/rustc_trait_selection/src/traits/project.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ impl<'me, 'tcx> BoundVarReplacer<'me, 'tcx> {
570570
}
571571
}
572572

573-
impl TypeFolder<'tcx> for BoundVarReplacer<'_, 'tcx> {
573+
impl<'tcx> TypeFolder<'tcx> for BoundVarReplacer<'_, 'tcx> {
574574
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
575575
self.infcx.tcx
576576
}
@@ -678,7 +678,7 @@ impl<'me, 'tcx> PlaceholderReplacer<'me, 'tcx> {
678678
}
679679
}
680680

681-
impl TypeFolder<'tcx> for PlaceholderReplacer<'_, 'tcx> {
681+
impl<'tcx> TypeFolder<'tcx> for PlaceholderReplacer<'_, 'tcx> {
682682
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
683683
self.infcx.tcx
684684
}
@@ -1937,14 +1937,14 @@ fn assoc_ty_def(
19371937
}
19381938
}
19391939

1940-
crate trait ProjectionCacheKeyExt<'tcx>: Sized {
1940+
crate trait ProjectionCacheKeyExt<'cx, 'tcx>: Sized {
19411941
fn from_poly_projection_predicate(
19421942
selcx: &mut SelectionContext<'cx, 'tcx>,
19431943
predicate: ty::PolyProjectionPredicate<'tcx>,
19441944
) -> Option<Self>;
19451945
}
19461946

1947-
impl<'tcx> ProjectionCacheKeyExt<'tcx> for ProjectionCacheKey<'tcx> {
1947+
impl<'cx, 'tcx> ProjectionCacheKeyExt<'cx, 'tcx> for ProjectionCacheKey<'tcx> {
19481948
fn from_poly_projection_predicate(
19491949
selcx: &mut SelectionContext<'cx, 'tcx>,
19501950
predicate: ty::PolyProjectionPredicate<'tcx>,

compiler/rustc_trait_selection/src/traits/query/type_op/normalize.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub trait Normalizable<'tcx>: fmt::Debug + TypeFoldable<'tcx> + Lift<'tcx> + Cop
3131
) -> Fallible<CanonicalizedQueryResponse<'tcx, Self>>;
3232
}
3333

34-
impl Normalizable<'tcx> for Ty<'tcx> {
34+
impl<'tcx> Normalizable<'tcx> for Ty<'tcx> {
3535
fn type_op_method(
3636
tcx: TyCtxt<'tcx>,
3737
canonicalized: Canonicalized<'tcx, ParamEnvAnd<'tcx, Normalize<Self>>>,
@@ -40,7 +40,7 @@ impl Normalizable<'tcx> for Ty<'tcx> {
4040
}
4141
}
4242

43-
impl Normalizable<'tcx> for ty::Predicate<'tcx> {
43+
impl<'tcx> Normalizable<'tcx> for ty::Predicate<'tcx> {
4444
fn type_op_method(
4545
tcx: TyCtxt<'tcx>,
4646
canonicalized: Canonicalized<'tcx, ParamEnvAnd<'tcx, Normalize<Self>>>,
@@ -49,7 +49,7 @@ impl Normalizable<'tcx> for ty::Predicate<'tcx> {
4949
}
5050
}
5151

52-
impl Normalizable<'tcx> for ty::PolyFnSig<'tcx> {
52+
impl<'tcx> Normalizable<'tcx> for ty::PolyFnSig<'tcx> {
5353
fn type_op_method(
5454
tcx: TyCtxt<'tcx>,
5555
canonicalized: Canonicalized<'tcx, ParamEnvAnd<'tcx, Normalize<Self>>>,
@@ -58,7 +58,7 @@ impl Normalizable<'tcx> for ty::PolyFnSig<'tcx> {
5858
}
5959
}
6060

61-
impl Normalizable<'tcx> for ty::FnSig<'tcx> {
61+
impl<'tcx> Normalizable<'tcx> for ty::FnSig<'tcx> {
6262
fn type_op_method(
6363
tcx: TyCtxt<'tcx>,
6464
canonicalized: Canonicalized<'tcx, ParamEnvAnd<'tcx, Normalize<Self>>>,

compiler/rustc_trait_selection/src/traits/query/type_op/outlives.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl<'tcx> DropckOutlives<'tcx> {
1414
}
1515
}
1616

17-
impl super::QueryTypeOp<'tcx> for DropckOutlives<'tcx> {
17+
impl<'tcx> super::QueryTypeOp<'tcx> for DropckOutlives<'tcx> {
1818
type QueryResponse = DropckOutlivesResult<'tcx>;
1919

2020
fn try_fast_path(

compiler/rustc_trait_selection/src/traits/specialize/specialization_graph.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ enum Inserted {
3232
ShouldRecurseOn(DefId),
3333
}
3434

35-
trait ChildrenExt {
35+
trait ChildrenExt<'tcx> {
3636
fn insert_blindly(&mut self, tcx: TyCtxt<'tcx>, impl_def_id: DefId);
3737
fn remove_existing(&mut self, tcx: TyCtxt<'tcx>, impl_def_id: DefId);
3838

3939
fn insert(
4040
&mut self,
41-
tcx: TyCtxt<'tcx>,
41+
tcx: TyCtxt<'_>,
4242
impl_def_id: DefId,
4343
simplified_self: Option<SimplifiedType>,
4444
) -> Result<Inserted, OverlapError>;
4545
}
4646

47-
impl ChildrenExt for Children {
47+
impl<'tcx> ChildrenExt<'tcx> for Children {
4848
/// Insert an impl into this set of children without comparing to any existing impls.
4949
fn insert_blindly(&mut self, tcx: TyCtxt<'tcx>, impl_def_id: DefId) {
5050
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
@@ -79,7 +79,7 @@ impl ChildrenExt for Children {
7979
/// specialization relationships.
8080
fn insert(
8181
&mut self,
82-
tcx: TyCtxt<'tcx>,
82+
tcx: TyCtxt<'_>,
8383
impl_def_id: DefId,
8484
simplified_self: Option<SimplifiedType>,
8585
) -> Result<Inserted, OverlapError> {
@@ -255,7 +255,7 @@ where
255255
}
256256
}
257257

258-
pub trait GraphExt {
258+
pub trait GraphExt<'tcx> {
259259
/// Insert a local impl into the specialization graph. If an existing impl
260260
/// conflicts with it (has overlap, but neither specializes the other),
261261
/// information about the area of overlap is returned in the `Err`.
@@ -269,7 +269,7 @@ pub trait GraphExt {
269269
fn record_impl_from_cstore(&mut self, tcx: TyCtxt<'tcx>, parent: DefId, child: DefId);
270270
}
271271

272-
impl GraphExt for Graph {
272+
impl<'tcx> GraphExt<'tcx> for Graph {
273273
/// Insert a local impl into the specialization graph. If an existing impl
274274
/// conflicts with it (has overlap, but neither specializes the other),
275275
/// information about the area of overlap is returned in the `Err`.

compiler/rustc_trait_selection/src/traits/structural_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub fn search_for_structural_match_violation<'tcx>(
6666
///
6767
/// Note that this does *not* recursively check if the substructure of `adt_ty`
6868
/// implements the traits.
69-
fn type_marked_structural(
69+
fn type_marked_structural<'tcx>(
7070
infcx: &InferCtxt<'_, 'tcx>,
7171
adt_ty: Ty<'tcx>,
7272
cause: ObligationCause<'tcx>,
@@ -119,7 +119,7 @@ struct Search<'a, 'tcx> {
119119
seen: FxHashSet<hir::def_id::DefId>,
120120
}
121121

122-
impl Search<'a, 'tcx> {
122+
impl<'a,'tcx> Search<'a, 'tcx> {
123123
fn tcx(&self) -> TyCtxt<'tcx> {
124124
self.infcx.tcx
125125
}

0 commit comments

Comments
 (0)