diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2019-10-04 14:21:12 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2019-10-04 14:21:12 +0200 |
| commit | 6dd86b411f08b3287ea565b41582641d496b66bf (patch) | |
| tree | 3c6d3db17c41cc256dbbc6d78deac4f6e654f6d0 | |
| parent | c59d33a063c34cf2b5da440947acb158b3755b99 (diff) | |
| download | rust-6dd86b411f08b3287ea565b41582641d496b66bf.tar.gz rust-6dd86b411f08b3287ea565b41582641d496b66bf.zip | |
Regression test for #63154.
| -rw-r--r-- | src/test/ui/nll/issue-63154-normalize.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/ui/nll/issue-63154-normalize.rs b/src/test/ui/nll/issue-63154-normalize.rs new file mode 100644 index 00000000000..2c18dc5d8e0 --- /dev/null +++ b/src/test/ui/nll/issue-63154-normalize.rs @@ -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(); +} |
