Skip to content

Compiler panic when calling map in a const expression #23828

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
withoutboats opened this issue Mar 29, 2015 · 2 comments
Closed

Compiler panic when calling map in a const expression #23828

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

Comments

@withoutboats
Copy link
Contributor

http://is.gd/zCNViG

const VV: Vec<&'static str> =
    vec!("A" , "B").drain().map(|s| s).collect::<Vec<&'static str>>();

Obviously it is intended that this code produce a compiler error, but it also causes the compiler to panic with this message:

thread 'rustc' panicked at 'assertion failed: self.mode == Mode::Var',
/home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc/middle/check_const.rs:232
@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 29, 2015
@ghost
Copy link

ghost commented May 14, 2015

More likely than not a dupe of #25180 but I'll leave open as it's slightly different.

@arielb1
Copy link
Contributor

arielb1 commented Jun 18, 2015

This does seem like a duplicate. Closing.

@arielb1 arielb1 closed this as completed Jun 18, 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

3 participants