2022-06-28 15:35:48 -05:00
|
|
|
#![feature(adt_const_params)]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Eq)]
|
|
|
|
struct Foo {
|
|
|
|
value: i32,
|
|
|
|
nested: &'static Bar<i32>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Eq)]
|
|
|
|
struct Bar<T>(T);
|
|
|
|
|
|
|
|
struct Test<const F: Foo>;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x: Test<{
|
|
|
|
Foo {
|
|
|
|
value: 3,
|
|
|
|
nested: &Bar(4),
|
2022-06-28 16:26:54 -05:00
|
|
|
}
|
2022-06-28 15:35:48 -05:00
|
|
|
}> = Test;
|
|
|
|
let y: Test<{
|
|
|
|
Foo {
|
|
|
|
value: 3,
|
|
|
|
nested: &Bar(5),
|
|
|
|
}
|
|
|
|
}> = x; //~ ERROR mismatched types
|
|
|
|
}
|