Skip to content

ICE with const as statement #29637

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
nrc opened this issue Nov 5, 2015 · 2 comments
Closed

ICE with const as statement #29637

nrc opened this issue Nov 5, 2015 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@nrc
Copy link
Member

nrc commented Nov 5, 2015

const FOO: i32 = 42;
fn main() {
    FOO;
}
<anon>:3:5: 3:9 warning: path statement with no effect, #[warn(path_statements)] on by default
<anon>:3     FOO;
             ^~~~
<anon>:3:5: 3:8 error: internal compiler error: constant expression should not reach expr::trans_def
<anon>:3     FOO;
             ^~~

Note that this is fixed by changing to let _ = FOO;.

@nrc nrc added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 5, 2015
@apasel422
Copy link
Contributor

This seems like a duplicate of #28104.

@nrc
Copy link
Member Author

nrc commented Nov 5, 2015

It is, closing

@nrc nrc closed this as completed Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants