diff options
Diffstat (limited to 'tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.rs')
| -rw-r--r-- | tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.rs b/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.rs new file mode 100644 index 00000000000..dc9efbf3b95 --- /dev/null +++ b/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.rs @@ -0,0 +1,13 @@ +//@ run-rustfix +//@ rustfix-only-machine-applicable + +// Make sure that simple overcapture suggestions remain machine applicable. + +#![allow(unused)] +#![deny(impl_trait_overcaptures)] + +fn named<'a>(x: &'a i32) -> impl Sized { *x } +//~^ ERROR `impl Sized` will capture more lifetimes than possibly intended in edition 2024 +//~| WARN this changes meaning in Rust 2024 + +fn main() {} |
