Closed
Description
The following code cause Rustc to fail:
extern
{
static foo: u64;
}
static bar: u64 = foo;
fn main()
{
}
With the following message :
task '<unnamed>' failed at 'const not bound to an item', /Users/leo/Downloads/rust/src/librustc/middle/check_const.rs:269
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task '<unnamed>' failed at 'explicit failure', /Users/leo/Downloads/rust/src/librustc/rustc.rs:391
Shouldn't Rustc be able to compile this code ? Since the foreign global is static, it should be possible to use it in constant expressions, juste like any static declared in Rust code.