about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAmanda Stjerna <amanda.stjerna@it.uu.se>2024-05-21 10:18:44 +0200
committerAmanda Stjerna <amanda.stjerna@it.uu.se>2024-06-12 15:47:32 +0200
commit7782d2023bd3fbaf28f4ecc66d51bb33b1e18491 (patch)
tree291e7b5b47df9c4a1c8ed94bac1b115c9b7942ac
parentaee846224cfaf6679acbf30986e6d2bb0de769ea (diff)
downloadrust-7782d2023bd3fbaf28f4ecc66d51bb33b1e18491.tar.gz
rust-7782d2023bd3fbaf28f4ecc66d51bb33b1e18491.zip
Roll back a few `#[instrument]`
Apparently this interferes with inlining and murders performance
on `wg-grammar`.
-rw-r--r--compiler/rustc_borrowck/src/region_infer/mod.rs27
1 files changed, 12 insertions, 15 deletions
diff --git a/compiler/rustc_borrowck/src/region_infer/mod.rs b/compiler/rustc_borrowck/src/region_infer/mod.rs
index 2f387e345ed..91dbbfb4973 100644
--- a/compiler/rustc_borrowck/src/region_infer/mod.rs
+++ b/compiler/rustc_borrowck/src/region_infer/mod.rs
@@ -1643,26 +1643,33 @@ impl<'tcx> RegionInferenceContext<'tcx> {
     ///   that cannot be named by `fr1`; in that case, we will require
     ///   that `fr1: 'static` because it is the only way to `fr1: r` to
     ///   be satisfied. (See `add_incompatible_universe`.)
-    #[instrument(skip(self), ret)]
     pub(crate) fn provides_universal_region(
         &self,
         r: RegionVid,
         fr1: RegionVid,
         fr2: RegionVid,
     ) -> bool {
-        let fr2_is_static = fr2 == self.universal_regions.fr_static;
-        r == fr2 || (fr2_is_static && self.cannot_name_placeholder(fr1, r))
+        debug!("provides_universal_region(r={:?}, fr1={:?}, fr2={:?})", r, fr1, fr2);
+        let result = {
+            r == fr2 || {
+                fr2 == self.universal_regions.fr_static && self.cannot_name_placeholder(fr1, r)
+            }
+        };
+        debug!("provides_universal_region: result = {:?}", result);
+        result
     }
 
     /// If `r2` represents a placeholder region, then this returns
     /// `true` if `r1` cannot name that placeholder in its
     /// value; otherwise, returns `false`.
-    #[instrument(skip(self), ret)]
     pub(crate) fn cannot_name_placeholder(&self, r1: RegionVid, r2: RegionVid) -> bool {
         match self.definitions[r2].origin {
             NllRegionVariableOrigin::Placeholder(placeholder) => {
                 let r1_universe = self.definitions[r1].universe;
-                debug!(?placeholder, ?r1_universe);
+                debug!(
+                    "cannot_name_value_of: universe1={r1_universe:?} placeholder={:?}",
+                    placeholder
+                );
                 r1_universe.cannot_name(placeholder.universe)
             }
 
@@ -2162,16 +2169,6 @@ impl<'tcx> RegionDefinition<'tcx> {
 
         Self { origin, universe, external_name: None }
     }
-
-    #[inline(always)]
-    pub fn is_placeholder(&self) -> bool {
-        matches!(self.origin, NllRegionVariableOrigin::Placeholder(_))
-    }
-
-    #[inline(always)]
-    pub fn is_existential(&self) -> bool {
-        matches!(self.origin, NllRegionVariableOrigin::Existential { .. })
-    }
 }
 
 #[derive(Clone, Debug)]