@@ -10,12 +10,12 @@ use rustc_trait_selection::traits;
10
10
use smallvec:: SmallVec ;
11
11
12
12
use crate :: astconv:: {
13
- AstConv , ConvertedBinding , ConvertedBindingKind , OnlySelfBounds , PredicateFilter ,
13
+ HirTyLowerer , LoweredBinding , LoweredBindingKind , OnlySelfBounds , PredicateFilter ,
14
14
} ;
15
15
use crate :: bounds:: Bounds ;
16
16
use crate :: errors;
17
17
18
- impl < ' tcx > dyn AstConv < ' tcx > + ' _ {
18
+ impl < ' tcx > dyn HirTyLowerer < ' tcx > + ' _ {
19
19
/// Sets `implicitly_sized` to true on `Bounds` if necessary
20
20
pub ( crate ) fn add_implicitly_sized (
21
21
& self ,
@@ -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_region ( lifetime, None ) ;
160
160
bounds. push_region_bound (
161
161
self . tcx ( ) ,
162
162
ty:: Binder :: bind_with_vars (
@@ -234,11 +234,11 @@ 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, speculative, dup_bindings, path_span) ) ]
237
- pub ( super ) fn add_predicates_for_ast_type_binding (
237
+ pub ( super ) fn lower_type_bindings_to_predicates (
238
238
& self ,
239
239
hir_ref_id : hir:: HirId ,
240
240
trait_ref : ty:: PolyTraitRef < ' tcx > ,
241
- binding : & ConvertedBinding < ' _ , ' tcx > ,
241
+ binding : & LoweredBinding < ' _ , ' tcx > ,
242
242
bounds : & mut Bounds < ' tcx > ,
243
243
speculative : bool ,
244
244
dup_bindings : & mut FxHashMap < DefId , Span > ,
@@ -266,15 +266,15 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
266
266
let assoc_kind =
267
267
if binding. gen_args . parenthesized == hir:: GenericArgsParentheses :: ReturnTypeNotation {
268
268
ty:: AssocKind :: Fn
269
- } else if let ConvertedBindingKind :: Equality ( term) = binding. kind
269
+ } else if let LoweredBindingKind :: Equality ( term) = binding. kind
270
270
&& let ty:: TermKind :: Const ( _) = term. node . unpack ( )
271
271
{
272
272
ty:: AssocKind :: Const
273
273
} else {
274
274
ty:: AssocKind :: Type
275
275
} ;
276
276
277
- let candidate = if self . trait_defines_associated_item_named (
277
+ let candidate = if self . trait_defines_assoc_item_named (
278
278
trait_ref. def_id ( ) ,
279
279
assoc_kind,
280
280
binding. item_name ,
@@ -420,7 +420,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
420
420
infer_args : false ,
421
421
} ;
422
422
423
- let args_trait_ref_and_assoc_item = self . create_args_for_associated_item (
423
+ let args_trait_ref_and_assoc_item = self . lower_args_for_assoc_item (
424
424
path_span,
425
425
assoc_item. def_id ,
426
426
& item_segment,
@@ -441,7 +441,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
441
441
//
442
442
// for<'a> <T as Iterator>::Item = &'a str // <-- 'a is bad
443
443
// for<'a> <T as FnMut<(&'a u32,)>>::Output = &'a str // <-- 'a is ok
444
- if let ConvertedBindingKind :: Equality ( ty) = binding. kind {
444
+ if let LoweredBindingKind :: Equality ( ty) = binding. kind {
445
445
let late_bound_in_trait_ref =
446
446
tcx. collect_constrained_late_bound_regions ( & projection_ty) ;
447
447
let late_bound_in_ty =
@@ -471,12 +471,12 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
471
471
}
472
472
473
473
match binding. kind {
474
- ConvertedBindingKind :: Equality ( ..) if let ty:: AssocKind :: Fn = assoc_kind => {
474
+ LoweredBindingKind :: Equality ( ..) if let ty:: AssocKind :: Fn = assoc_kind => {
475
475
return Err ( self . tcx ( ) . dcx ( ) . emit_err (
476
476
crate :: errors:: ReturnTypeNotationEqualityBound { span : binding. span } ,
477
477
) ) ;
478
478
}
479
- ConvertedBindingKind :: Equality ( term) => {
479
+ LoweredBindingKind :: Equality ( term) => {
480
480
// "Desugar" a constraint like `T: Iterator<Item = u32>` this to
481
481
// the "projection predicate" for:
482
482
//
@@ -490,7 +490,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
490
490
binding. span ,
491
491
) ;
492
492
}
493
- ConvertedBindingKind :: Constraint ( ast_bounds) => {
493
+ LoweredBindingKind :: Constraint ( ast_bounds) => {
494
494
// "Desugar" a constraint like `T: Iterator<Item: Debug>` to
495
495
//
496
496
// `<T as Iterator>::Item: Debug`
0 commit comments