Skip to content

Commit 254b7bf

Browse files
committed
Try using inline(always) to avoid a runtime regression
1 parent 29eb8ff commit 254b7bf

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_middle/src/ty/context

1 file changed

+3
-3
lines changed

compiler/rustc_middle/src/ty/context/tls.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ where
115115
}
116116

117117
/// Allows access to the current `ImplicitCtxt` in a closure if one is available.
118-
#[inline]
118+
#[inline(always)]
119119
pub fn with_context_opt<F, R>(f: F) -> R
120120
where
121121
F: for<'a, 'tcx> FnOnce(Option<&ImplicitCtxt<'a, 'tcx>>) -> R,
@@ -134,7 +134,7 @@ where
134134

135135
/// Allows access to the current `ImplicitCtxt`.
136136
/// Panics if there is no `ImplicitCtxt` available.
137-
#[inline]
137+
#[inline(always)]
138138
pub fn with_context<F, R>(f: F) -> R
139139
where
140140
F: for<'a, 'tcx> FnOnce(&ImplicitCtxt<'a, 'tcx>) -> R,
@@ -147,7 +147,7 @@ where
147147
/// as the `TyCtxt` passed in.
148148
/// This will panic if you pass it a `TyCtxt` which is different from the current
149149
/// `ImplicitCtxt`'s `tcx` field.
150-
#[inline]
150+
#[inline(always)]
151151
pub fn with_related_context<'tcx, F, R>(tcx: TyCtxt<'tcx>, f: F) -> R
152152
where
153153
F: FnOnce(&ImplicitCtxt<'_, 'tcx>) -> R,

0 commit comments

Comments
 (0)