Closed
Description
First reported here this code:
#![warn(rust_2018_idioms)]
macro_rules! foo {
($name:ident) => {
pub struct $name;
impl ::std::fmt::Debug for $name {
fn fmt(&self, _fmt: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
Ok(())
}
}
}
}
foo!(One);
foo!(Two);
fn main() {}
when compiled yields two warnings to insert anonymous lifetimes. While we as humans can figure this out pretty well, Cargo as a merciless program can't figure this out and cargo fix
attempts to apply the fix twice, creating invalid <'_><'_>
syntax.
It's not clear whether it's best to fix this in cargo fix
or fix this in the compiler itself. I figure it's easiest to track all idiom-lint related issues in this repository though, so I've opted to move it over here.
Metadata
Metadata
Assignees
Labels
Area: The 2018 editionArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Suggestions generated by the compiler applied by `cargo fix`Category: This is a bug.Diagnostics: A structured suggestion resulting in incorrect code.Lint: elided_lifetimes_in_pathsRelevant to the compiler team, which will review and decide on the PR/issue.