[DO NOT MERGE] Add a crater lint for issue 145739 by ShoyuVanilla · Pull Request #149291 · rust-lang/rust (original) (raw)

I took some weird hack that expands the following macro call

into

{ super let args = (&x,); super let args = [format_argument::new_display(args.0)]; // &x is for getting the information of captured parameter, // and the units have the same spans with actual parmeter occurrences, which can be used for lints let __issue_145739 = (&x, (), ()); unsafe { format_arguments::new(b"\xc0\x01 \xc8\x00\x00\x01\n\x00", &args) } }

and then look for those let stmt with __issue_145739 later in the late lint pass.

It's because in early lint, we don't have much information other than AST, while in late lint, we have quite much information but not for AST 😂 So I have to leave some information about AST before executing late lint - macro expansion - and I think this would be okay as this lint will be used only for crater runs