rust/compiler/rustc_passes
Matthias Krüger 5c4ede88c6
Rollup merge of #126938 - RalfJung:link_section, r=compiler-errors
miri: make sure we can find link_section statics even for the local crate

Miri needs some way to iterate all the exported functions and "used" statics of all crates. For dependency crates, this already works fine since we can overwrite the query resonsible for computing `exported_symbols`, but it turns out for local binary crates this does not work: for binaries, `reachable_set` skips a lot of its logic and only checks `contains_extern_indicator()` and `RUSTC_STD_INTERNAL_SYMBOL`. Other flags like `CodegenFnAttrFlags::USED` are entirely ignored.

This PR proposes to use the same check, `has_custom_linkage`, in binaries that we already use to drive the main workqueue of the reachability recursive traversal. I have no idea why binaries used a slightly different check that ignores `USED` -- was that deliberate or does it just not matter most of the time?
2024-06-26 07:50:19 +02:00
..
src Rollup merge of #126938 - RalfJung:link_section, r=compiler-errors 2024-06-26 07:50:19 +02:00
Cargo.toml Test and implement reachability for trait objects and generic parameters of functions 2024-03-14 14:10:45 +00:00
messages.ftl coverage: Always error on #[coverage(..)] in unexpected places 2024-06-24 20:15:03 +10:00