Closed
Description
This takes a while to compile. I presume because loop {}
needs to hit the loop checker in miri. Changing the _
to _foo
or foo
will immediately bail out due to &(loop{}, 1).1
not living for the 'static
lifetime.
#![feature(nll)]
fn main() {
let _: &'static usize = &(loop {}, 1).1;
}
Errors:
Compiling playground v0.0.1 (file:///playground)
warning: unreachable expression
--> src/main.rs:4:40
|
4 | let _: &'static usize = &(loop {}, 1).1;
| ^
|
= note: #[warn(unreachable_code)] on by default
Finished dev [unoptimized + debuginfo] target(s) in 1.09s
Running `target/debug/playground`
/root/entrypoint.sh: line 8: 7 Killed timeout --signal=KILL ${timeout} "$@"
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Relevant to the compiler team, which will review and decide on the PR/issue.