rust/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
386 B
Rust
Raw Permalink Normal View History

//@ 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 + use<> { *x }
//~^ ERROR `impl Sized` will capture more lifetimes than possibly intended in edition 2024
//~| WARN this changes meaning in Rust 2024
fn main() {}