mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
a3637032db
previously, we would warn like this: ```` warning: lifetime parameter `'s` never used --> /tmp/unusedlif/code.rs:6:62 | 5 | #[derive(Clone)] | - help: elide the unused lifetime 6 | struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As)); | ^^ | = note: requested on the command line with `-W unused-lifetimes` ```` Fixes #104432
13 lines
287 B
Rust
13 lines
287 B
Rust
// check-pass
|
|
|
|
#![deny(unused_lifetimes)]
|
|
trait Trait2 {
|
|
type As;
|
|
}
|
|
|
|
// we should not warn about an unused lifetime about code generated from this proc macro here
|
|
#[derive(Clone)]
|
|
struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As));
|
|
|
|
pub fn main() {}
|