Skip to content

Commit 7782d20

Browse files
committed
Roll back a few #[instrument]
Apparently this interferes with inlining and murders performance on `wg-grammar`.
1 parent aee8462 commit 7782d20

File tree

1 file changed

+12
-15
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+12
-15
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

+12-15
Original file line numberDiff line numberDiff line change
@@ -1643,26 +1643,33 @@ impl<'tcx> RegionInferenceContext<'tcx> {
16431643
/// that cannot be named by `fr1`; in that case, we will require
16441644
/// that `fr1: 'static` because it is the only way to `fr1: r` to
16451645
/// be satisfied. (See `add_incompatible_universe`.)
1646-
#[instrument(skip(self), ret)]
16471646
pub(crate) fn provides_universal_region(
16481647
&self,
16491648
r: RegionVid,
16501649
fr1: RegionVid,
16511650
fr2: RegionVid,
16521651
) -> bool {
1653-
let fr2_is_static = fr2 == self.universal_regions.fr_static;
1654-
r == fr2 || (fr2_is_static && self.cannot_name_placeholder(fr1, r))
1652+
debug!("provides_universal_region(r={:?}, fr1={:?}, fr2={:?})", r, fr1, fr2);
1653+
let result = {
1654+
r == fr2 || {
1655+
fr2 == self.universal_regions.fr_static && self.cannot_name_placeholder(fr1, r)
1656+
}
1657+
};
1658+
debug!("provides_universal_region: result = {:?}", result);
1659+
result
16551660
}
16561661

16571662
/// If `r2` represents a placeholder region, then this returns
16581663
/// `true` if `r1` cannot name that placeholder in its
16591664
/// value; otherwise, returns `false`.
1660-
#[instrument(skip(self), ret)]
16611665
pub(crate) fn cannot_name_placeholder(&self, r1: RegionVid, r2: RegionVid) -> bool {
16621666
match self.definitions[r2].origin {
16631667
NllRegionVariableOrigin::Placeholder(placeholder) => {
16641668
let r1_universe = self.definitions[r1].universe;
1665-
debug!(?placeholder, ?r1_universe);
1669+
debug!(
1670+
"cannot_name_value_of: universe1={r1_universe:?} placeholder={:?}",
1671+
placeholder
1672+
);
16661673
r1_universe.cannot_name(placeholder.universe)
16671674
}
16681675

@@ -2162,16 +2169,6 @@ impl<'tcx> RegionDefinition<'tcx> {
21622169

21632170
Self { origin, universe, external_name: None }
21642171
}
2165-
2166-
#[inline(always)]
2167-
pub fn is_placeholder(&self) -> bool {
2168-
matches!(self.origin, NllRegionVariableOrigin::Placeholder(_))
2169-
}
2170-
2171-
#[inline(always)]
2172-
pub fn is_existential(&self) -> bool {
2173-
matches!(self.origin, NllRegionVariableOrigin::Existential { .. })
2174-
}
21752172
}
21762173

21772174
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)