File tree 2 files changed +9
-9
lines changed
rustc_middle/src/ty/print
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ thread_local! {
65
65
/// Avoids running any queries during any prints that occur
66
66
/// during the closure. This may alter the appearance of some
67
67
/// types (e.g. forcing verbose printing for opaque types).
68
- /// This method is used during some queries (e.g. `predicates_of `
68
+ /// This method is used during some queries (e.g. `explicit_item_bounds `
69
69
/// for opaque types), to ensure that any debug printing that
70
70
/// occurs during the query computation does not end up recursively
71
71
/// calling the same query.
Original file line number Diff line number Diff line change @@ -61,23 +61,23 @@ fn opaque_type_bounds<'tcx>(
61
61
bounds : & ' tcx [ hir:: GenericBound < ' tcx > ] ,
62
62
span : Span ,
63
63
) -> & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] {
64
- let item_ty =
65
- tcx. mk_opaque ( opaque_def_id, InternalSubsts :: identity_for_item ( tcx, opaque_def_id) ) ;
64
+ ty:: print:: with_no_queries ( || {
65
+ let item_ty =
66
+ tcx. mk_opaque ( opaque_def_id, InternalSubsts :: identity_for_item ( tcx, opaque_def_id) ) ;
66
67
67
- let bounds = ty:: print:: with_no_queries ( || {
68
- AstConv :: compute_bounds (
68
+ let bounds = AstConv :: compute_bounds (
69
69
& ItemCtxt :: new ( tcx, opaque_def_id) ,
70
70
item_ty,
71
71
bounds,
72
72
SizedByDefault :: Yes ,
73
73
span,
74
74
)
75
- } ) ;
75
+ . predicates ( tcx , item_ty ) ;
76
76
77
- let bounds = bounds. predicates ( tcx, item_ty) ;
78
- debug ! ( "opaque_type_bounds({}) = {:?}" , tcx. def_path_str( opaque_def_id) , bounds) ;
77
+ debug ! ( "opaque_type_bounds({}) = {:?}" , tcx. def_path_str( opaque_def_id) , bounds) ;
79
78
80
- tcx. arena . alloc_slice ( & bounds)
79
+ tcx. arena . alloc_slice ( & bounds)
80
+ } )
81
81
}
82
82
83
83
pub ( super ) fn explicit_item_bounds (
You can’t perform that action at this time.
0 commit comments