Don't use exported generics from conditional dependencies (panic runtimes and profiler-builtins) - #160306
Don't use exported generics from conditional dependencies (panic runtimes and profiler-builtins)#160306saethlin wants to merge 1 commit into
Conversation
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| // If std depends on exported generics from the unwinding runtime, it may encounter | ||
| // link-time errors when swapped to a different one. | ||
| // https://github.com/rust-lang/rust/issues/159682 | ||
| if self.is_panic_runtime(LOCAL_CRATE) { |
There was a problem hiding this comment.
Can we check for conditional dependencies here instead of hard coding panic runtimes?
There was a problem hiding this comment.
🤷 it seems kind of goofy to export the symbols then never use them but sure
There was a problem hiding this comment.
A single crate can be a conditional dependency of one crate and an unconditional dependency of a later crate. For the second crate it would be safe to use the exported generics. I guess it doesn't matter much for panic runtimes. The current code is a bit safer against any future kinds of conditional dependencies we might introduce.
39dd7ac to
0fb8cb8
Compare
This comment has been minimized.
This comment has been minimized.
0fb8cb8 to
601ee8e
Compare
|
r=me with CI passing. |
This is a fix for #159682.
This seems like a generalized footgun for writing FFI plugins? But at least right now, a very specific change to the crates we often swap around seems prudent.