Skip to content

Commit 004dcf9

Browse files
committed
Auto merge of #143667 - tgross35:rollup-yqitltm, r=tgross35
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142357 (Simplify LLVM bitcode linker in bootstrap and add tests for it) - rust-lang/rust#143177 (Remove false label when `self` resolve failure does not relate to macro) - rust-lang/rust#143339 (Respect endianness correctly in CheckEnums test suite) - rust-lang/rust#143426 (clippy fix: indentation) - rust-lang/rust#143475 (tests: Use `cfg_target_has_reliable_f16_f128` in `conv-bits-runtime-const`) - rust-lang/rust#143499 (Don't call `predicates_of` on a dummy obligation cause's body id) - rust-lang/rust#143520 (Fix perf regression caused by tracing) - rust-lang/rust#143532 (More carefully consider span context when suggesting remove `&mut`) - rust-lang/rust#143606 (configure.py: Write last key in each section) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 13b5370 + 4a59481 commit 004dcf9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/machine.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,6 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
10141014

10151015
const PANIC_ON_ALLOC_FAIL: bool = false;
10161016

1017-
const TRACING_ENABLED: bool = cfg!(feature = "tracing");
1018-
10191017
#[inline(always)]
10201018
fn enforce_alignment(ecx: &MiriInterpCx<'tcx>) -> bool {
10211019
ecx.machine.check_alignment != AlignmentCheck::None
@@ -1827,6 +1825,16 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
18271825
#[cfg(not(target_os = "linux"))]
18281826
MiriAllocParams::Global
18291827
}
1828+
1829+
fn enter_trace_span(span: impl FnOnce() -> tracing::Span) -> impl EnteredTraceSpan {
1830+
#[cfg(feature = "tracing")]
1831+
{ span().entered() }
1832+
#[cfg(not(feature = "tracing"))]
1833+
{
1834+
let _ = span; // so we avoid the "unused variable" warning
1835+
()
1836+
}
1837+
}
18301838
}
18311839

18321840
/// Trait for callbacks handling asynchronous machine operations.

0 commit comments

Comments
 (0)