Skip to content

Commit 2d2ba6a

Browse files
author
The Miri Cronjob Bot
committed
Merge from rustc
2 parents a795293 + 88ecf3f commit 2d2ba6a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/helpers.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,14 @@ pub fn iter_exported_symbols<'tcx>(
152152
let dependency_format = dependency_formats
153153
.get(&CrateType::Executable)
154154
.expect("interpreting a non-executable crate");
155-
for cnum in dependency_format.iter().enumerate().filter_map(|(num, &linkage)| {
156-
// We add 1 to the number because that's what rustc also does everywhere it
157-
// calls `CrateNum::new`...
158-
#[expect(clippy::arithmetic_side_effects)]
159-
(linkage != Linkage::NotLinked).then_some(CrateNum::new(num + 1))
160-
}) {
155+
for cnum in dependency_format
156+
.iter_enumerated()
157+
.filter_map(|(num, &linkage)| (linkage != Linkage::NotLinked).then_some(num))
158+
{
159+
if cnum == LOCAL_CRATE {
160+
continue; // Already handled above
161+
}
162+
161163
// We can ignore `_export_info` here: we are a Rust crate, and everything is exported
162164
// from a Rust crate.
163165
for &(symbol, _export_info) in tcx.exported_symbols(cnum) {

0 commit comments

Comments
 (0)