about summary refs log tree commit diff
path: root/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.rs
blob: dc9efbf3b95e886d7388bd77e551a9761bc2d5c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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() {}