Fix query cycle when tracing explicit_item_bounds
This commit is contained in:
parent
ffe52882ed
commit
1f5c655d0c
2 changed files with 9 additions and 9 deletions
|
@ -65,7 +65,7 @@ thread_local! {
|
||||||
/// Avoids running any queries during any prints that occur
|
/// Avoids running any queries during any prints that occur
|
||||||
/// during the closure. This may alter the appearance of some
|
/// during the closure. This may alter the appearance of some
|
||||||
/// types (e.g. forcing verbose printing for opaque types).
|
/// types (e.g. forcing verbose printing for opaque types).
|
||||||
/// This method is used during some queries (e.g. `predicates_of`
|
/// This method is used during some queries (e.g. `explicit_item_bounds`
|
||||||
/// for opaque types), to ensure that any debug printing that
|
/// for opaque types), to ensure that any debug printing that
|
||||||
/// occurs during the query computation does not end up recursively
|
/// occurs during the query computation does not end up recursively
|
||||||
/// calling the same query.
|
/// calling the same query.
|
||||||
|
|
|
@ -61,23 +61,23 @@ fn opaque_type_bounds<'tcx>(
|
||||||
bounds: &'tcx [hir::GenericBound<'tcx>],
|
bounds: &'tcx [hir::GenericBound<'tcx>],
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> &'tcx [(ty::Predicate<'tcx>, Span)] {
|
) -> &'tcx [(ty::Predicate<'tcx>, Span)] {
|
||||||
let item_ty =
|
ty::print::with_no_queries(|| {
|
||||||
tcx.mk_opaque(opaque_def_id, InternalSubsts::identity_for_item(tcx, opaque_def_id));
|
let item_ty =
|
||||||
|
tcx.mk_opaque(opaque_def_id, InternalSubsts::identity_for_item(tcx, opaque_def_id));
|
||||||
|
|
||||||
let bounds = ty::print::with_no_queries(|| {
|
let bounds = AstConv::compute_bounds(
|
||||||
AstConv::compute_bounds(
|
|
||||||
&ItemCtxt::new(tcx, opaque_def_id),
|
&ItemCtxt::new(tcx, opaque_def_id),
|
||||||
item_ty,
|
item_ty,
|
||||||
bounds,
|
bounds,
|
||||||
SizedByDefault::Yes,
|
SizedByDefault::Yes,
|
||||||
span,
|
span,
|
||||||
)
|
)
|
||||||
});
|
.predicates(tcx, item_ty);
|
||||||
|
|
||||||
let bounds = bounds.predicates(tcx, item_ty);
|
debug!("opaque_type_bounds({}) = {:?}", tcx.def_path_str(opaque_def_id), bounds);
|
||||||
debug!("opaque_type_bounds({}) = {:?}", tcx.def_path_str(opaque_def_id), bounds);
|
|
||||||
|
|
||||||
tcx.arena.alloc_slice(&bounds)
|
tcx.arena.alloc_slice(&bounds)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn explicit_item_bounds(
|
pub(super) fn explicit_item_bounds(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue