diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-11-16 08:58:55 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-11-16 09:37:33 -0500 |
| commit | 6575988d8e383fedd3d5579577c05ef23e77913b (patch) | |
| tree | 407dfba0a678148f806b64063bf9836eee4739a2 /src/test | |
| parent | 0d744ec6eca622aa63bb89f02e819e4270fa5794 (diff) | |
| download | rust-6575988d8e383fedd3d5579577c05ef23e77913b.tar.gz rust-6575988d8e383fedd3d5579577c05ef23e77913b.zip | |
handle trait objects formed from traits with `Self::Foo: 'a` clauses
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/rfc-2093-infer-outlives/issue-54467.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs b/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs new file mode 100644 index 00000000000..438923e2924 --- /dev/null +++ b/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs @@ -0,0 +1,17 @@ +// Regression test for #54467: +// +// Here, the trait object has an "inferred outlives" requirement that +// `<Self as MyIterator<'a>>::Item: 'a`; but since we don't know what +// `Self` is, we were (incorrectly) messing things up, leading to +// strange errors. This test ensures that we do not give compilation +// errors. +// +// compile-pass + +trait MyIterator<'a>: Iterator where Self::Item: 'a { } + +struct MyStruct<'a, A> { + item: Box<dyn MyIterator<'a, Item = A>> +} + +fn main() { } |
