-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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.
Description
The following (incorrect) code produces an ICE on stable and nightly:
struct A;
impl From<A> for &'static str {
fn from(&self) -> &'static str {
""
}
}
fn main(){}
error: internal compiler error: /checkout/src/librustc/infer/region_constraints/mod.rs:685: cannot relate bound region: ReStatic <= ReLateBound(DebruijnIndex { depth: 1 }, BrAnon(0))
Playground link: https://play.rust-lang.org/?gist=b86bdb728a9bd24e747744c075fd87fc&version=stable
I appreciate this code shouldn't compile; the from
method should take A
not &self
. But it's an ICE regardless.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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.