Closed
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.