Closed
Description
// othercrate.rs
pub struct Foo(u8);
static OK: Foo = Foo(1);
// crosscratetuple.rs
extern crate othercrate;
static ERR: othercrate::Foo = othercrate::Foo(1);
fn main() {}
rustc othercrate.rs --crate-type lib
compiles fine (other than the dead code warning for OK
), but rustc -L . crosscratetuple.rs
is not:
crosscratetuple.rs:3:31: 3:49 error: function calls in constants are limited to struct and enum constructors [E0015]
crosscratetuple.rs:3 static ERR: othercrate::Foo = othercrate::Foo(1);
^~~~~~~~~~~~~~~~~~
Metadata
Metadata
Assignees
Labels
No labels