File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
- 8a1f8039a7ded79d3d4fe97b110016d89f2b11e2
1
+ 13170cd787cb733ed24842ee825bcbd98dc01476
Original file line number Diff line number Diff line change @@ -152,12 +152,14 @@ pub fn iter_exported_symbols<'tcx>(
152
152
let dependency_format = dependency_formats
153
153
. get ( & CrateType :: Executable )
154
154
. 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
+
161
163
// We can ignore `_export_info` here: we are a Rust crate, and everything is exported
162
164
// from a Rust crate.
163
165
for & ( symbol, _export_info) in tcx. exported_symbols ( cnum) {
You can’t perform that action at this time.
0 commit comments