2024-07-14 07:38:51 -05:00
|
|
|
#![feature(adt_const_params, unsized_const_params)]
|
2022-06-28 15:35:48 -05:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
2024-07-14 07:38:51 -05:00
|
|
|
use std::marker::UnsizedConstParamTy;
|
2023-05-16 23:05:46 -05:00
|
|
|
|
2024-07-14 07:38:51 -05:00
|
|
|
#[derive(Debug, PartialEq, Eq, UnsizedConstParamTy)]
|
2022-06-28 15:35:48 -05:00
|
|
|
struct Foo {
|
|
|
|
value: i32,
|
|
|
|
nested: &'static Bar<i32>,
|
|
|
|
}
|
|
|
|
|
2024-07-14 07:38:51 -05:00
|
|
|
#[derive(Debug, PartialEq, Eq, UnsizedConstParamTy)]
|
2022-06-28 15:35:48 -05:00
|
|
|
struct Bar<T>(T);
|
|
|
|
|
|
|
|
struct Test<const F: Foo>;
|
|
|
|
|
|
|
|
fn main() {
|
2024-07-14 07:38:51 -05:00
|
|
|
let x: Test<{ Foo { value: 3, nested: &Bar(4) } }> = Test;
|
|
|
|
let y: Test<{ Foo { value: 3, nested: &Bar(5) } }> = x; //~ ERROR mismatched types
|
2022-06-28 15:35:48 -05:00
|
|
|
}
|