diff options
| author | bors <bors@rust-lang.org> | 2024-12-20 15:02:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-20 15:02:34 +0000 |
| commit | fcc1615e47100b376d0a6166faccdd4a8253c314 (patch) | |
| tree | 53916ffc1b11178590054eb9cbd85ee3510efcbf /src | |
| parent | 8a1f8039a7ded79d3d4fe97b110016d89f2b11e2 (diff) | |
| parent | 594e74d56ff467daf8f33a2f972933803eca7b2c (diff) | |
| download | rust-fcc1615e47100b376d0a6166faccdd4a8253c314.tar.gz rust-fcc1615e47100b376d0a6166faccdd4a8253c314.zip | |
Auto merge of #134559 - DianQK:rollup-22iraj9, r=DianQK
Rollup of 5 pull requests Successful merges: - #134366 (Fix logical error with what text is considered whitespace.) - #134514 (Improve dependency_format a bit) - #134519 (ci: use ubuntu `24` instead of `latest`) - #134551 (coverage: Rename `basic_coverage_blocks` to just `graph`) - #134553 (add member constraints comment) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/miri/src/helpers.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/tools/miri/src/helpers.rs b/src/tools/miri/src/helpers.rs index 2b27400e9e3..e817e0f90dc 100644 --- a/src/tools/miri/src/helpers.rs +++ b/src/tools/miri/src/helpers.rs @@ -152,12 +152,14 @@ pub fn iter_exported_symbols<'tcx>( let dependency_format = dependency_formats .get(&CrateType::Executable) .expect("interpreting a non-executable crate"); - for cnum in dependency_format.iter().enumerate().filter_map(|(num, &linkage)| { - // We add 1 to the number because that's what rustc also does everywhere it - // calls `CrateNum::new`... - #[expect(clippy::arithmetic_side_effects)] - (linkage != Linkage::NotLinked).then_some(CrateNum::new(num + 1)) - }) { + for cnum in dependency_format + .iter_enumerated() + .filter_map(|(num, &linkage)| (linkage != Linkage::NotLinked).then_some(num)) + { + if cnum == LOCAL_CRATE { + continue; // Already handled above + } + // We can ignore `_export_info` here: we are a Rust crate, and everything is exported // from a Rust crate. for &(symbol, _export_info) in tcx.exported_symbols(cnum) { |
