about summary refs log tree commit diff
path: root/tests/ui/const-generics/issue-66451.rs
blob: 9ce7658586ad19a0d61e765027cfb14f9b6142b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(adt_const_params, unsized_const_params)]
#![allow(incomplete_features)]

use std::marker::ConstParamTy;

#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Foo {
    value: i32,
    nested: &'static Bar<i32>,
}

#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Bar<T>(T);

struct Test<const F: Foo>;

fn main() {
    let x: Test<{ Foo { value: 3, nested: &Bar(4) } }> = Test;
    let y: Test<{ Foo { value: 3, nested: &Bar(5) } }> = x; //~ ERROR mismatched types
}