diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-07-24 17:45:27 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-08-05 19:02:23 +0500 |
| commit | 62c92f30cf02fc56b8a774c77097f1111dc2f4ea (patch) | |
| tree | fe8c9846c6ca02b176ea9adcb8a348bd5ead1846 /tests/ui/closures | |
| parent | 0f353363965ebf05e0757f7679c800b39c51a07e (diff) | |
| download | rust-62c92f30cf02fc56b8a774c77097f1111dc2f4ea.tar.gz rust-62c92f30cf02fc56b8a774c77097f1111dc2f4ea.zip | |
moved 35 tests to organized locations
Diffstat (limited to 'tests/ui/closures')
| -rw-r--r-- | tests/ui/closures/boxed-closure-lifetime-13808.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/closures/boxed-closure-lifetime-13808.rs b/tests/ui/closures/boxed-closure-lifetime-13808.rs new file mode 100644 index 00000000000..d2961b35f2e --- /dev/null +++ b/tests/ui/closures/boxed-closure-lifetime-13808.rs @@ -0,0 +1,17 @@ +//@ run-pass +#![allow(dead_code)] +#![allow(unused_variables)] + +struct Foo<'a> { + listener: Box<dyn FnMut() + 'a>, +} + +impl<'a> Foo<'a> { + fn new<F>(listener: F) -> Foo<'a> where F: FnMut() + 'a { + Foo { listener: Box::new(listener) } + } +} + +fn main() { + let a = Foo::new(|| {}); +} |
