mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
ace436743f
Without it non-WF types could pass typeck and then later fail in MIR/const eval
17 lines
295 B
Rust
17 lines
295 B
Rust
// Test that we check the types of statics are well-formed.
|
|
|
|
#![feature(associated_type_defaults)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
struct IsCopy<T:Copy> { t: T }
|
|
struct NotCopy;
|
|
|
|
static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
|
|
//~^ ERROR E0277
|
|
//~| ERROR E0277
|
|
//~| ERROR E0277
|
|
|
|
|
|
fn main() { }
|