Regression test for #63154.
This commit is contained in:
parent
c59d33a063
commit
6dd86b411f
1 changed files with 34 additions and 0 deletions
34
src/test/ui/nll/issue-63154-normalize.rs
Normal file
34
src/test/ui/nll/issue-63154-normalize.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// Regression test for rust-lang/rust#63154
|
||||
//
|
||||
// Before, we would ICE after faiing to normalize the destination type
|
||||
// when checking call destinations and also when checking MIR
|
||||
// assignment statements.
|
||||
|
||||
// check-pass
|
||||
|
||||
trait HasAssocType {
|
||||
type Inner;
|
||||
}
|
||||
|
||||
impl HasAssocType for () {
|
||||
type Inner = ();
|
||||
}
|
||||
|
||||
trait Tr<I, T>: Fn(I) -> Option<T> {}
|
||||
impl<I, T, Q: Fn(I) -> Option<T>> Tr<I, T> for Q {}
|
||||
|
||||
fn f<T: HasAssocType>() -> impl Tr<T, T::Inner> {
|
||||
|_| None
|
||||
}
|
||||
|
||||
fn g<T, Y>(f: impl Tr<T, Y>) -> impl Tr<T, Y> {
|
||||
f
|
||||
}
|
||||
|
||||
fn h() {
|
||||
g(f())(());
|
||||
}
|
||||
|
||||
fn main() {
|
||||
h();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue