Skip to content

ICE on record update with "fail" as base record #4113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rntz opened this issue Dec 5, 2012 · 3 comments
Closed

ICE on record update with "fail" as base record #4113

rntz opened this issue Dec 5, 2012 · 3 comments
Labels
A-codegen Area: Code generation E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@rntz
Copy link
Contributor

rntz commented Dec 5, 2012

struct Foo { x: int }

fn main() {
  let _ = Foo { x: 0, ..fail };
}

Compiling this results in an ICE:

bugs/record-update-ice.rs:4:24: 4:28 error: internal compiler error: bad base expr type in record
bugs/record-update-ice.rs:4   let _ = Foo { x: 0, ..fail };
                                                    ^~~~
@yjh0502
Copy link
Contributor

yjh0502 commented Feb 28, 2013

I just tried to compile a code above, and it produces following output. It seems that the bug is already fixed.

test.rs:4:28: 4:32 error: unresolved name: fail
test.rs:4       let _ = Foo { x: 0, ..fail };
                                      ^~~~
error: aborting due to previous error

@sanxiyn
Copy link
Member

sanxiyn commented Feb 28, 2013

No, syntax change is masking ICE. This still reproduces after changing fail to fail!().

@graydon
Copy link
Contributor

graydon commented May 22, 2013

Apparently fixed with some recent work in the typechecker:

./t.rs:4:6: 4:33 error: cannot determine a type for this local variable: unconstrained type
./t.rs:4   let _ = Foo { x: 0, ..fail!() };
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

Closing as fixed. Reopen if you feel this is not correct behavior.

@graydon graydon closed this as completed May 22, 2013
RalfJung added a commit to RalfJung/rust that referenced this issue Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants