Auto merge of #82159 - BoxyUwU:uwu, r=varkor
Use correct param_env in conservative_is_privately_uninhabited cc `@lcnr` r? `@varkor` since this is your FIXME that was removed ^^
This commit is contained in:
commit
1fdadbf13a
9 changed files with 131 additions and 57 deletions
|
|
@ -0,0 +1,27 @@
|
|||
// run-pass
|
||||
#![feature(const_generics, const_evaluatable_checked)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
// This tests that the `conservative_is_privately_uninhabited` fn doesn't cause
|
||||
// ICEs by trying to evaluate `T::ASSOC` with an incorrect `ParamEnv`.
|
||||
|
||||
trait Foo {
|
||||
const ASSOC: usize = 1;
|
||||
}
|
||||
|
||||
struct Iced<T: Foo>(T, [(); T::ASSOC])
|
||||
where
|
||||
[(); T::ASSOC]: ;
|
||||
|
||||
impl Foo for u32 {}
|
||||
|
||||
fn foo<T: Foo>()
|
||||
where
|
||||
[(); T::ASSOC]: ,
|
||||
{
|
||||
let _iced: Iced<T> = return;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo::<u32>();
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// run-pass
|
||||
#![feature(const_generics, const_evaluatable_checked)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
// This tests that the `conservative_is_privately_uninhabited` fn doesn't cause
|
||||
// ICEs by trying to evaluate `T::ASSOC` with an incorrect `ParamEnv`.
|
||||
|
||||
trait Foo {
|
||||
const ASSOC: usize = 1;
|
||||
}
|
||||
|
||||
struct Iced<T: Foo>(T, [(); T::ASSOC])
|
||||
where
|
||||
[(); T::ASSOC]: ;
|
||||
|
||||
impl Foo for u32 {}
|
||||
|
||||
fn main() {
|
||||
let _iced: Iced<u32> = return;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue