Skip to content

Commit

Permalink
Try using inline(always) to avoid a runtime regression
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Mar 2, 2023
1 parent 29eb8ff commit 254b7bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/ty/context/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ where
}

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

/// Allows access to the current `ImplicitCtxt`.
/// Panics if there is no `ImplicitCtxt` available.
#[inline]
#[inline(always)]
pub fn with_context<F, R>(f: F) -> R
where
F: for<'a, 'tcx> FnOnce(&ImplicitCtxt<'a, 'tcx>) -> R,
Expand All @@ -147,7 +147,7 @@ where
/// as the `TyCtxt` passed in.
/// This will panic if you pass it a `TyCtxt` which is different from the current
/// `ImplicitCtxt`'s `tcx` field.
#[inline]
#[inline(always)]
pub fn with_related_context<'tcx, F, R>(tcx: TyCtxt<'tcx>, f: F) -> R
where
F: FnOnce(&ImplicitCtxt<'_, 'tcx>) -> R,
Expand Down

0 comments on commit 254b7bf

Please sign in to comment.