- Notifications
You must be signed in to change notification settings - Fork 14k
Open
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-linkersArea: linkers... you gotta love linkersArea: linkers... you gotta love linkersA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
I tried this code:
use std::process::ExitCode; use std::process::Termination; trait IsStatic {} impl<'a: 'static> IsStatic for &'a () {} struct Thing; impl Termination for Thing where for<'a> &'a (): IsStatic { fn report(self) -> ExitCode { panic!() } } fn main() -> Thing { Thing }I expected a normal compiler error. Instead, I got the following:
error: linking with `cc` failed: exit status: 1 | = note: "cc" ....... <arguments omitted for brevity of this issue> = note: some arguments are omitted. use `--verbose` to show all linker arguments = note: rust-lld: error: undefined hidden symbol: std::rt::lang_start::h005004333204f9e0 >>> referenced by playground.b3525d8026055c0f-cgu.0 >>> /playground/target/debug/deps/playground-65a1e30147052435.playground.b3525d8026055c0f-cgu.0.rcgu.o:(main) collect2: error: ld returned 1 exit status Meta
Reproducible on the playground with version 1.93.0-nightly (2025-11-01 bd3ac0330018c23b111b)
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-linkersArea: linkers... you gotta love linkersArea: linkers... you gotta love linkersA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.