diff options
Diffstat (limited to 'tests/ui/regions/regions-no-bound-in-argument-cleanup.rs')
-rw-r--r-- | tests/ui/regions/regions-no-bound-in-argument-cleanup.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/regions/regions-no-bound-in-argument-cleanup.rs b/tests/ui/regions/regions-no-bound-in-argument-cleanup.rs new file mode 100644 index 000000000..aafab5d86 --- /dev/null +++ b/tests/ui/regions/regions-no-bound-in-argument-cleanup.rs @@ -0,0 +1,24 @@ +// run-pass +// pretty-expanded FIXME #23616 + +use std::marker; + +pub struct Foo<T>(marker::PhantomData<T>); + +impl<T> Iterator for Foo<T> { + type Item = T; + + fn next(&mut self) -> Option<T> { + None + } +} + +impl<T> Drop for Foo<T> { + fn drop(&mut self) { + self.next(); + } +} + +pub fn foo<'a>(_: Foo<&'a ()>) {} + +pub fn main() {} |