File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -151,12 +151,14 @@ pub fn iter_exported_symbols<'tcx>(
151151 let dependency_format = dependency_formats
152152 . get ( & CrateType :: Executable )
153153 . expect ( "interpreting a non-executable crate" ) ;
154- for cnum in dependency_format. iter ( ) . enumerate ( ) . filter_map ( |( num, & linkage) | {
155- // We add 1 to the number because that's what rustc also does everywhere it
156- // calls `CrateNum::new`...
157- #[ expect( clippy:: arithmetic_side_effects) ]
158- ( linkage != Linkage :: NotLinked ) . then_some ( CrateNum :: new ( num + 1 ) )
159- } ) {
154+ for cnum in dependency_format
155+ . iter_enumerated ( )
156+ . filter_map ( |( num, & linkage) | ( linkage != Linkage :: NotLinked ) . then_some ( num) )
157+ {
158+ if cnum == LOCAL_CRATE {
159+ continue ; // Already handled above
160+ }
161+
160162 // We can ignore `_export_info` here: we are a Rust crate, and everything is exported
161163 // from a Rust crate.
162164 for & ( symbol, _export_info) in tcx. exported_symbols ( cnum) {
You can’t perform that action at this time.
0 commit comments