1
1
use crate :: mir:: interpret:: { AllocRange , GlobalAlloc , Pointer , Provenance , Scalar } ;
2
2
use crate :: query:: IntoQueryParam ;
3
3
use crate :: query:: Providers ;
4
- use crate :: traits:: util:: { super_predicates_for_pretty_printing, supertraits_for_pretty_printing} ;
5
4
use crate :: ty:: GenericArgKind ;
6
5
use crate :: ty:: {
7
6
ConstInt , Expr , ParamConst , ScalarInt , Term , TermKind , TypeFoldable , TypeSuperFoldable ,
@@ -23,6 +22,7 @@ use rustc_span::symbol::{kw, Ident, Symbol};
23
22
use rustc_span:: FileNameDisplayPreference ;
24
23
use rustc_target:: abi:: Size ;
25
24
use rustc_target:: spec:: abi:: Abi ;
25
+ use rustc_type_ir:: { elaborate, Upcast as _} ;
26
26
use smallvec:: SmallVec ;
27
27
28
28
use std:: cell:: Cell ;
@@ -1255,14 +1255,14 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
1255
1255
entry. has_fn_once = true ;
1256
1256
return ;
1257
1257
} else if self . tcx ( ) . is_lang_item ( trait_def_id, LangItem :: FnMut ) {
1258
- let super_trait_ref = supertraits_for_pretty_printing ( self . tcx ( ) , trait_ref)
1258
+ let super_trait_ref = elaborate :: supertraits ( self . tcx ( ) , trait_ref)
1259
1259
. find ( |super_trait_ref| super_trait_ref. def_id ( ) == fn_once_trait)
1260
1260
. unwrap ( ) ;
1261
1261
1262
1262
fn_traits. entry ( super_trait_ref) . or_default ( ) . fn_mut_trait_ref = Some ( trait_ref) ;
1263
1263
return ;
1264
1264
} else if self . tcx ( ) . is_lang_item ( trait_def_id, LangItem :: Fn ) {
1265
- let super_trait_ref = supertraits_for_pretty_printing ( self . tcx ( ) , trait_ref)
1265
+ let super_trait_ref = elaborate :: supertraits ( self . tcx ( ) , trait_ref)
1266
1266
. find ( |super_trait_ref| super_trait_ref. def_id ( ) == fn_once_trait)
1267
1267
. unwrap ( ) ;
1268
1268
@@ -1343,10 +1343,11 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
1343
1343
let bound_principal_with_self = bound_principal
1344
1344
. with_self_ty ( cx. tcx ( ) , cx. tcx ( ) . types . trait_object_dummy_self ) ;
1345
1345
1346
- let super_projections: Vec < _ > =
1347
- super_predicates_for_pretty_printing ( cx. tcx ( ) , bound_principal_with_self)
1348
- . filter_map ( |clause| clause. as_projection_clause ( ) )
1349
- . collect ( ) ;
1346
+ let clause: ty:: Clause < ' tcx > = bound_principal_with_self. upcast ( cx. tcx ( ) ) ;
1347
+ let super_projections: Vec < _ > = elaborate:: elaborate ( cx. tcx ( ) , [ clause] )
1348
+ . filter_only_self ( )
1349
+ . filter_map ( |clause| clause. as_projection_clause ( ) )
1350
+ . collect ( ) ;
1350
1351
1351
1352
let mut projections: Vec < _ > = predicates
1352
1353
. projection_bounds ( )
0 commit comments