summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs
blob: 3543960c3ebdf3419e85efc26da158d29c707618 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

// This test is a repro for #82279. It checks that we don't error
// when calling is_const_evaluatable on `std::mem::size_of::<T>()`
// when looking for candidates that may prove `T: Foo` in `foo`

trait Foo {}

#[allow(dead_code)]
fn foo<T: Foo>() {}

impl<T> Foo for T where [(); std::mem::size_of::<T>()]:  {}

fn main() {}