mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
22 lines
437 B
Rust
22 lines
437 B
Rust
// Don't const eval fields with ambiguous layout.
|
|
// See issues #125842 and #124464.
|
|
|
|
enum TestOption<T> {
|
|
TestSome(T),
|
|
TestSome(T),
|
|
//~^ ERROR the name `TestSome` is defined multiple times
|
|
}
|
|
|
|
pub struct Request {
|
|
bar: TestOption<u64>,
|
|
bar: u8,
|
|
//~^ ERROR field `bar` is already declared
|
|
}
|
|
|
|
fn default_instance() -> &'static Request {
|
|
static instance: Request = Request { bar: 17 };
|
|
&instance
|
|
}
|
|
|
|
pub fn main() {}
|