Rollup merge of #88592 - b-naber:region_substs, r=oli-obk

Fix ICE in const check

Fixes https://github.com/rust-lang/rust/issues/88433
This commit is contained in:
Mara Bos 2021-09-02 19:10:24 +02:00 committed by GitHub
commit c082e157ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 17 deletions

View file

@ -0,0 +1,26 @@
// build-pass
#![feature(const_trait_impl)]
trait Func<T> {
type Output;
fn call_once(self, arg: T) -> Self::Output;
}
struct Closure;
impl const Func<&usize> for Closure {
type Output = usize;
fn call_once(self, arg: &usize) -> Self::Output {
*arg
}
}
enum Bug<T = [(); Closure.call_once(&0) ]> {
V(T),
}
fn main() {}