diff options
Diffstat (limited to 'src/test/ui/closures/issue-102089-multiple-opaque-cast.rs')
-rw-r--r-- | src/test/ui/closures/issue-102089-multiple-opaque-cast.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/closures/issue-102089-multiple-opaque-cast.rs b/src/test/ui/closures/issue-102089-multiple-opaque-cast.rs new file mode 100644 index 000000000..043bf06a1 --- /dev/null +++ b/src/test/ui/closures/issue-102089-multiple-opaque-cast.rs @@ -0,0 +1,17 @@ +// edition:2021 +// check-pass + +pub struct Example<'a, T> { + a: T, + b: &'a T, +} + +impl<'a, T> Example<'a, T> { + pub fn error_trying_to_destructure_self_in_closure(self) { + let closure = || { + let Self { a, b } = self; + }; + } +} + +fn main() {} |