11use crate :: mir:: interpret:: { AllocRange , GlobalAlloc , Pointer , Provenance , Scalar } ;
22use crate :: query:: IntoQueryParam ;
33use crate :: query:: Providers ;
4- use crate :: traits:: util:: { super_predicates_for_pretty_printing, supertraits_for_pretty_printing} ;
54use crate :: ty:: GenericArgKind ;
65use crate :: ty:: {
76 ConstInt , Expr , ParamConst , ScalarInt , Term , TermKind , TypeFoldable , TypeSuperFoldable ,
@@ -23,6 +22,7 @@ use rustc_span::symbol::{kw, Ident, Symbol};
2322use rustc_span:: FileNameDisplayPreference ;
2423use rustc_target:: abi:: Size ;
2524use rustc_target:: spec:: abi:: Abi ;
25+ use rustc_type_ir:: { elaborate, Upcast as _} ;
2626use smallvec:: SmallVec ;
2727
2828use std:: cell:: Cell ;
@@ -1255,14 +1255,14 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
12551255 entry. has_fn_once = true ;
12561256 return ;
12571257 } 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)
12591259 . find ( |super_trait_ref| super_trait_ref. def_id ( ) == fn_once_trait)
12601260 . unwrap ( ) ;
12611261
12621262 fn_traits. entry ( super_trait_ref) . or_default ( ) . fn_mut_trait_ref = Some ( trait_ref) ;
12631263 return ;
12641264 } 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)
12661266 . find ( |super_trait_ref| super_trait_ref. def_id ( ) == fn_once_trait)
12671267 . unwrap ( ) ;
12681268
@@ -1343,10 +1343,11 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
13431343 let bound_principal_with_self = bound_principal
13441344 . with_self_ty ( cx. tcx ( ) , cx. tcx ( ) . types . trait_object_dummy_self ) ;
13451345
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 ( ) ;
13501351
13511352 let mut projections: Vec < _ > = predicates
13521353 . projection_bounds ( )
0 commit comments