Skip to content

Commit a593d8d

Browse files
committed
HACK
1 parent 26d6e08 commit a593d8d

File tree

2 files changed

+33
-28
lines changed

2 files changed

+33
-28
lines changed

compiler/rustc_trait_selection/src/solve/normalize.rs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub fn deeply_normalize<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>(
3131
/// Additionally takes a list of universes which represents the binders which have been
3232
/// entered before passing `value` to the function. This is currently needed for
3333
/// `normalize_erasing_regions`, which skips binders as it walks through a type.
34+
#[instrument(level = "debug", skip(at, universes), ret)]
3435
pub fn deeply_normalize_with_skipped_universes<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>(
3536
at: At<'_, 'tcx>,
3637
value: T,

library/std/src/backtrace.rs

+32-28
Original file line numberDiff line numberDiff line change
@@ -428,37 +428,41 @@ impl fmt::Display for Backtrace {
428428
}
429429
}
430430

431-
type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync + UnwindSafe;
432-
433-
fn lazy_resolve(mut capture: Capture) -> LazyResolve {
434-
move || {
435-
// Use the global backtrace lock to synchronize this as it's a
436-
// requirement of the `backtrace` crate, and then actually resolve
437-
// everything.
438-
let _lock = lock();
439-
for frame in capture.frames.iter_mut() {
440-
let symbols = &mut frame.symbols;
441-
let frame = match &frame.frame {
442-
RawFrame::Actual(frame) => frame,
443-
#[cfg(test)]
444-
RawFrame::Fake => unimplemented!(),
445-
};
446-
unsafe {
447-
backtrace_rs::resolve_frame_unsynchronized(frame, |symbol| {
448-
symbols.push(BacktraceSymbol {
449-
name: symbol.name().map(|m| m.as_bytes().to_vec()),
450-
filename: symbol.filename_raw().map(|b| match b {
451-
BytesOrWideString::Bytes(b) => BytesOrWide::Bytes(b.to_owned()),
452-
BytesOrWideString::Wide(b) => BytesOrWide::Wide(b.to_owned()),
453-
}),
454-
lineno: symbol.lineno(),
455-
colno: symbol.colno(),
431+
use define::*;
432+
mod define {
433+
use super::*;
434+
pub(super) type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync + UnwindSafe;
435+
436+
pub(super) fn lazy_resolve(mut capture: Capture) -> LazyResolve {
437+
move || {
438+
// Use the global backtrace lock to synchronize this as it's a
439+
// requirement of the `backtrace` crate, and then actually resolve
440+
// everything.
441+
let _lock = lock();
442+
for frame in capture.frames.iter_mut() {
443+
let symbols = &mut frame.symbols;
444+
let frame = match &frame.frame {
445+
RawFrame::Actual(frame) => frame,
446+
#[cfg(test)]
447+
RawFrame::Fake => unimplemented!(),
448+
};
449+
unsafe {
450+
backtrace_rs::resolve_frame_unsynchronized(frame, |symbol| {
451+
symbols.push(BacktraceSymbol {
452+
name: symbol.name().map(|m| m.as_bytes().to_vec()),
453+
filename: symbol.filename_raw().map(|b| match b {
454+
BytesOrWideString::Bytes(b) => BytesOrWide::Bytes(b.to_owned()),
455+
BytesOrWideString::Wide(b) => BytesOrWide::Wide(b.to_owned()),
456+
}),
457+
lineno: symbol.lineno(),
458+
colno: symbol.colno(),
459+
});
456460
});
457-
});
461+
}
458462
}
459-
}
460463

461-
capture
464+
capture
465+
}
462466
}
463467
}
464468

0 commit comments

Comments
 (0)