- Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Closed
Copy link
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.