1
Fork 0

Auto merge of #103975 - oli-obk:tracing, r=jackh726

Some tracing and comment cleanups

Pulled out of https://github.com/rust-lang/rust/pull/101900 to see if that is the perf impact
This commit is contained in:
bors 2022-11-06 02:21:34 +00:00
commit a4ab2e0643
10 changed files with 23 additions and 56 deletions

View file

@ -146,6 +146,7 @@ impl Qualif for NeedsNonConstDrop {
qualifs.needs_non_const_drop
}
#[instrument(level = "trace", skip(cx), ret)]
fn in_any_value_of_ty<'tcx>(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {
// Avoid selecting for simple cases, such as builtin types.
if ty::util::is_trivially_const_drop(ty) {
@ -174,6 +175,8 @@ impl Qualif for NeedsNonConstDrop {
return true;
};
trace!(?impl_src);
if !matches!(
impl_src,
ImplSource::ConstDestruct(_) | ImplSource::Param(_, ty::BoundConstness::ConstIfConst)