diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-03-19 00:13:06 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-03-19 00:15:24 -0400 |
| commit | fda913baae46ddaff88754bde06d02ccb824d921 (patch) | |
| tree | 2a635475210b1c9721c10d16737e82920739381b | |
| parent | 57e1da59cd0761330b4ea8d47b16340a78eeafa9 (diff) | |
| download | rust-fda913baae46ddaff88754bde06d02ccb824d921.tar.gz rust-fda913baae46ddaff88754bde06d02ccb824d921.zip | |
Add regression test for TAIT lifetime inference (issue #55099)
Fixes #55099 The minimized reproducer in issue #55099 now compiles successfully. This commit adds a regression test for it.
| -rw-r--r-- | src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs new file mode 100644 index 00000000000..8e8508cdd6f --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs @@ -0,0 +1,28 @@ +// check-pass +// Regression test for issue #55099 +// Tests that we don't incorrectly consider a lifetime to part +// of the concrete type + +#![feature(type_alias_impl_trait)] + +trait Future { +} + +struct AndThen<F>(F); + +impl<F> Future for AndThen<F> { +} + +struct Foo<'a> { + x: &'a mut (), +} + +type F = impl Future; + +impl<'a> Foo<'a> { + fn reply(&mut self) -> F { + AndThen(|| ()) + } +} + +fn main() {} |
