mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
18 lines
348 B
Rust
18 lines
348 B
Rust
// Test that the variance computation considers types that
|
|
// appear in const expressions to be invariant.
|
|
|
|
#![feature(rustc_attrs)]
|
|
#![allow(incomplete_features)]
|
|
#![feature(generic_const_exprs)]
|
|
|
|
trait Trait {
|
|
const Const: usize;
|
|
}
|
|
|
|
#[rustc_variance]
|
|
struct Foo<T: Trait> { //~ ERROR [o]
|
|
field: [u8; <T as Trait>::Const]
|
|
}
|
|
|
|
fn main() { }
|