Skip to content

Commit a71a008

Browse files
committed
Auto merge of #2086 - nbdd0121:master, r=RalfJung
Update export_symbols Follow up to rust-lang/rust#96402
2 parents 3ac7ca4 + f8f776f commit a71a008

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
51ea9bb29b07d76c5a7167d054b54f4eb7f5b44e
1+
18b53cefdf7456bf68937b08e377b7e622a115c2

src/bin/miri.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ use rustc_errors::emitter::{ColorConfig, HumanReadableErrorType};
2222
use rustc_hir::{self as hir, def_id::LOCAL_CRATE, Node};
2323
use rustc_interface::interface::Config;
2424
use rustc_middle::{
25-
middle::exported_symbols::{ExportedSymbol, SymbolExportLevel},
25+
middle::exported_symbols::{
26+
ExportedSymbol, SymbolExportInfo, SymbolExportKind, SymbolExportLevel,
27+
},
2628
ty::{query::ExternProviders, TyCtxt},
2729
};
2830
use rustc_session::{config::ErrorOutputType, search_paths::PathKind, CtfeBacktrace};
@@ -130,7 +132,14 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
130132
&& tcx.codegen_fn_attrs(local_def_id).contains_extern_indicator())
131133
.then_some((
132134
ExportedSymbol::NonGeneric(local_def_id.to_def_id()),
133-
SymbolExportLevel::C,
135+
// Some dummy `SymbolExportInfo` here. We only use
136+
// `exported_symbols` in shims/foreign_items.rs and the export info
137+
// is ignored.
138+
SymbolExportInfo {
139+
level: SymbolExportLevel::C,
140+
kind: SymbolExportKind::Text,
141+
used: false,
142+
},
134143
))
135144
}),
136145
)

src/shims/foreign_items.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
157157
(linkage != Linkage::NotLinked).then_some(CrateNum::new(num + 1))
158158
}),
159159
) {
160-
// We can ignore `_export_level` here: we are a Rust crate, and everything is exported
160+
// We can ignore `_export_info` here: we are a Rust crate, and everything is exported
161161
// from a Rust crate.
162-
for &(symbol, _export_level) in tcx.exported_symbols(cnum) {
162+
for &(symbol, _export_info) in tcx.exported_symbols(cnum) {
163163
if let ExportedSymbol::NonGeneric(def_id) = symbol {
164164
let attrs = tcx.codegen_fn_attrs(def_id);
165165
let symbol_name = if let Some(export_name) = attrs.export_name {

0 commit comments

Comments
 (0)