Skip to content
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

internal compiler error: const expr(10: &*"sth") of type &'static str has size 8 instead of 16 #33648

Closed
gui1117 opened this issue May 15, 2016 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@gui1117
Copy link
Contributor

gui1117 commented May 15, 2016

I raise an internal compiler error on play.rust-lang.org stable beta and nightly and on my machine.

I tried this code:

fn main() {
    let _ = &*"sth";
}

I expect no error even if I would write it differently.
instead I got error: internal compiler error: const expr(10: &*"sth") of type &'static str has size 8 instead of 16

@apasel422 apasel422 added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 17, 2016
@zackmdavis
Copy link
Member

Doesn't seem to reproduce anymore?

$ rustc --version
rustc 1.14.0-nightly (a3bc191b5 2016-10-10)
$ cat scratch.rs 
fn main() {
    let _ = &*"sth";
}
$ rustc scratch.rs 
$ echo $?
0

@TimNN
Copy link
Contributor

TimNN commented Oct 16, 2016

Indeed, this seems to be fixed also on stable & beta, and there was a regression test added in #35533.

@TimNN TimNN closed this as completed Oct 16, 2016
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

4 participants