Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![deny(elided_lifetimes_in_paths)]
- #[derive(Copy, Clone)]
- struct Test<'a>(&'a str);
- fn main() {
- let u = "test";
- let t = Test(u);
- // Type as Trait
- // <Test as Clone>::clone(&t); // not allowed with the lint
- <Test<'_> as Clone>::clone(&t); // allowed, required with the lint
- // Type in angle brackets
- // <Test>::clone(&t); // not allowed with the lint
- <Test<'_>>::clone(&t); // allowed, required with the lint
- // Type not in angle brackets
- Test::clone(&t); // always allowed
- // Test<'_>::clone(&t); // never allowed
- }
Add Comment
Please, Sign In to add comment