Skip to content

Commit 31afa73

Browse files
committed
Merge from rustc
2 parents 1aa793f + ec2846e commit 31afa73

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bin/miri.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,14 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
109109
// an empty result if `tcx.sess.opts.output_types.should_codegen()` is false.
110110
local_providers.exported_symbols = |tcx, cnum| {
111111
assert_eq!(cnum, LOCAL_CRATE);
112+
let reachable_set = tcx.with_stable_hashing_context(|hcx| {
113+
tcx.reachable_set(()).to_sorted(&hcx, true)
114+
});
112115
tcx.arena.alloc_from_iter(
113116
// This is based on:
114117
// https://github.com/rust-lang/rust/blob/2962e7c0089d5c136f4e9600b7abccfbbde4973d/compiler/rustc_codegen_ssa/src/back/symbol_export.rs#L62-L63
115118
// https://github.com/rust-lang/rust/blob/2962e7c0089d5c136f4e9600b7abccfbbde4973d/compiler/rustc_codegen_ssa/src/back/symbol_export.rs#L174
116-
tcx.reachable_set(()).iter().filter_map(|&local_def_id| {
119+
reachable_set.into_iter().filter_map(|&local_def_id| {
117120
// Do the same filtering that rustc does:
118121
// https://github.com/rust-lang/rust/blob/2962e7c0089d5c136f4e9600b7abccfbbde4973d/compiler/rustc_codegen_ssa/src/back/symbol_export.rs#L84-L102
119122
// Otherwise it may cause unexpected behaviours and ICEs

0 commit comments

Comments
 (0)