]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / const-generics / conservative_is_privately_uninhabited_uses_correct_param_env-2.rs
CommitLineData
6a06907d 1// run-pass
94222f64 2#![feature(generic_const_exprs)]
6a06907d
XL
3#![allow(incomplete_features)]
4
5// This tests that the `conservative_is_privately_uninhabited` fn doesn't cause
6// ICEs by trying to evaluate `T::ASSOC` with an incorrect `ParamEnv`.
7
8trait Foo {
9 const ASSOC: usize = 1;
10}
11
12struct Iced<T: Foo>(T, [(); T::ASSOC])
13where
14 [(); T::ASSOC]: ;
15
16impl Foo for u32 {}
17
18fn main() {
19 let _iced: Iced<u32> = return;
20}