1 // aux-build:proc_macro_attr.rs
3 #![warn(clippy::needless_arbitrary_self_type)]
6 extern crate proc_macro_attr;
9 // Check that we don't lint if the `self` parameter comes from expansion
11 macro_rules! test_from_expansion {
20 fn test(self: &Self) {}
25 test_from_expansion!();
27 // If only the lifetime name comes from expansion we will lint, but the suggestion will have
28 // placeholders and will not be applied automatically, as we can't reliably know the original name.
29 // This specific case happened with async_trait.
32 fn call_with_mut_self(&mut self);
37 // The method's signature will be expanded to:
38 // fn call_with_mut_self<'life0>(self: &'life0 mut Self) {}
39 #[rename_my_lifetimes]
41 fn call_with_mut_self(self: &mut Self) {}