summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs
blob: 2fa9a71fbb33c081df2117483ce04796f58c85b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

// This test is a minimized reproduction for #79518 where
// during error handling for the type mismatch we would try
// to evaluate std::mem::size_of::<Self::Assoc> causing an ICE

trait Foo {
    type Assoc: PartialEq;
    const AssocInstance: Self::Assoc;

    fn foo()
    where
        [(); std::mem::size_of::<Self::Assoc>()]: ,
    {
        Self::AssocInstance == [(); std::mem::size_of::<Self::Assoc>()];
        //~^ Error: mismatched types
    }
}

fn main() {}