@@ -12,13 +12,13 @@ use rustc_trait_selection::traits;
12
12
use rustc_type_ir:: visit:: { TypeSuperVisitable , TypeVisitable , TypeVisitableExt , TypeVisitor } ;
13
13
use smallvec:: SmallVec ;
14
14
15
- use crate :: astconv:: { AstConv , OnlySelfBounds , PredicateFilter } ;
15
+ use crate :: astconv:: { HirTyLowerer , OnlySelfBounds , PredicateFilter } ;
16
16
use crate :: bounds:: Bounds ;
17
17
use crate :: errors;
18
18
19
- impl < ' tcx > dyn AstConv < ' tcx > + ' _ {
19
+ impl < ' tcx > dyn HirTyLowerer < ' tcx > + ' _ {
20
20
/// Sets `implicitly_sized` to true on `Bounds` if necessary
21
- pub ( crate ) fn add_implicitly_sized (
21
+ pub ( crate ) fn add_sized_bound (
22
22
& self ,
23
23
bounds : & mut Bounds < ' tcx > ,
24
24
self_ty : Ty < ' tcx > ,
@@ -117,7 +117,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
117
117
/// `param_ty` and `ast_bounds`. See `instantiate_poly_trait_ref`
118
118
/// for more details.
119
119
#[ instrument( level = "debug" , skip( self , ast_bounds, bounds) ) ]
120
- pub ( crate ) fn add_bounds < ' hir , I : Iterator < Item = & ' hir hir:: GenericBound < ' tcx > > > (
120
+ pub ( crate ) fn lower_poly_bounds < ' hir , I : Iterator < Item = & ' hir hir:: GenericBound < ' tcx > > > (
121
121
& self ,
122
122
param_ty : Ty < ' tcx > ,
123
123
ast_bounds : I ,
@@ -145,7 +145,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
145
145
}
146
146
hir:: TraitBoundModifier :: Maybe => continue ,
147
147
} ;
148
- let _ = self . instantiate_poly_trait_ref (
148
+ let _ = self . lower_poly_trait_ref (
149
149
& poly_trait_ref. trait_ref ,
150
150
poly_trait_ref. span ,
151
151
constness,
@@ -156,7 +156,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
156
156
) ;
157
157
}
158
158
hir:: GenericBound :: Outlives ( lifetime) => {
159
- let region = self . ast_region_to_region ( lifetime, None ) ;
159
+ let region = self . lower_lifetime ( lifetime, None ) ;
160
160
bounds. push_region_bound (
161
161
self . tcx ( ) ,
162
162
ty:: Binder :: bind_with_vars (
@@ -186,7 +186,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
186
186
/// example above, but is not true in supertrait listings like `trait Foo: Bar + Baz`.
187
187
///
188
188
/// `span` should be the declaration size of the parameter.
189
- pub ( crate ) fn compute_bounds (
189
+ pub ( crate ) fn lower_mono_bounds (
190
190
& self ,
191
191
param_ty : Ty < ' tcx > ,
192
192
ast_bounds : & [ hir:: GenericBound < ' tcx > ] ,
@@ -201,7 +201,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
201
201
PredicateFilter :: SelfOnly | PredicateFilter :: SelfThatDefines ( _) => OnlySelfBounds ( true ) ,
202
202
} ;
203
203
204
- self . add_bounds (
204
+ self . lower_poly_bounds (
205
205
param_ty,
206
206
ast_bounds. iter ( ) . filter ( |bound| match filter {
207
207
PredicateFilter :: All
@@ -234,7 +234,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
234
234
/// `trait_ref` here will be `for<'a> T: Iterator`. The `binding` data however is from *inside*
235
235
/// the binder (e.g., `&'a u32`) and hence may reference bound regions.
236
236
#[ instrument( level = "debug" , skip( self , bounds, dup_bindings, path_span) ) ]
237
- pub ( super ) fn add_predicates_for_ast_type_binding (
237
+ pub ( super ) fn lower_assoc_item_binding (
238
238
& self ,
239
239
hir_ref_id : hir:: HirId ,
240
240
trait_ref : ty:: PolyTraitRef < ' tcx > ,
@@ -272,7 +272,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
272
272
ty:: AssocKind :: Type
273
273
} ;
274
274
275
- let candidate = if self . trait_defines_associated_item_named (
275
+ let candidate = if self . probe_trait_that_defines_assoc_item (
276
276
trait_ref. def_id ( ) ,
277
277
assoc_kind,
278
278
binding. ident ,
@@ -282,7 +282,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
282
282
} else {
283
283
// Otherwise, we have to walk through the supertraits to find
284
284
// one that does define it.
285
- self . one_bound_for_assoc_item (
285
+ self . probe_single_bound_for_assoc_item (
286
286
|| traits:: supertraits ( tcx, trait_ref) ,
287
287
trait_ref. skip_binder ( ) . print_only_trait_name ( ) ,
288
288
None ,
@@ -417,7 +417,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
417
417
infer_args : false ,
418
418
} ;
419
419
420
- let alias_args = self . create_args_for_associated_item (
420
+ let alias_args = self . lower_generic_args_of_assoc_item (
421
421
path_span,
422
422
assoc_item. def_id ,
423
423
& item_segment,
@@ -451,7 +451,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
451
451
}
452
452
hir:: TypeBindingKind :: Equality { term } => {
453
453
let term = match term {
454
- hir:: Term :: Ty ( ty) => self . ast_ty_to_ty ( ty) . into ( ) ,
454
+ hir:: Term :: Ty ( ty) => self . lower_ty ( ty) . into ( ) ,
455
455
hir:: Term :: Const ( ct) => ty:: Const :: from_anon_const ( tcx, ct. def_id ) . into ( ) ,
456
456
} ;
457
457
@@ -514,7 +514,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
514
514
// for the `Self` type.
515
515
if !only_self_bounds. 0 {
516
516
let param_ty = Ty :: new_alias ( tcx, ty:: Projection , projection_ty. skip_binder ( ) ) ;
517
- self . add_bounds (
517
+ self . lower_poly_bounds (
518
518
param_ty,
519
519
ast_bounds. iter ( ) ,
520
520
bounds,
0 commit comments