Closed
Description
cc @RalfJung
#![feature(const_let)]
const FOO: *const u32 = {
let x = 42;
&x
};
fn main() {
let x = FOO;
}
Errors:
Compiling playground v0.0.1 (/playground)
warning: unused variable: `x`
--> src/main.rs:10:9
|
10 | let x = FOO;
| ^ help: consider using `_x` instead
|
= note: #[warn(unused_variables)] on by default
error: internal compiler error: librustc_mir/monomorphize/collector.rs:1174: alloc id without corresponding allocation: 3
thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:600:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.31.0-nightly (f99911a4a 2018-10-23) running on x86_64-unknown-linux-gnu
note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `playground`.
To learn more, run the command again with --verbose.