-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
struct Foo {
foo: int,
}
struct Bar {
bar: int,
}
impl Bar {
fn make_foo (&self, i: int) -> ~Foo {
return ~Foo { nonexistent: self, foo: i };
}
}
fn main () {
let bar = Bar { bar: 1 };
let foo = bar.make_foo(2);
io::println(fmt!("%d", foo.foo));
}
produces
test2.rs:11:22: 11:39 error: structure has no field named `nonexistent`
test2.rs:11 return ~Foo { nonexistent: self, foo: i };
^~~~~~~~~~~~~~~~~
error: internal compiler error: no type for node 23: expr self (id=23) in fcx 7f5d0c438ce0
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️