diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/regions/regions-no-bound-in-argument-cleanup.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/regions/regions-no-bound-in-argument-cleanup.rs b/src/test/ui/regions/regions-no-bound-in-argument-cleanup.rs new file mode 100644 index 000000000..aafab5d86 --- /dev/null +++ b/src/test/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() {} |