1
Fork 0
rust/compiler/rustc_interface/src
bors 72da5a9d85 Auto merge of #77671 - flip1995:lint_list_always_plugins, r=oli-obk,Manishearth
Always print lints from plugins, if they're available

Currently you can get a list of lints and lint groups by running `rustc
-Whelp`. This prints an additional line at the end:
```
Compiler plugins can provide additional lints and lint groups. To see a listing of these, re-run `rustc -W help` with a crate filename.
```

Clippy is such a "compiler plugin", that provides additional lints.
Running `clippy-driver -Whelp` (`rustc` wrapper) still only prints the
rustc lints with the above message at the end. But when running
`clippy-driver -Whelp main.rs`, where `main.rs` is any rust file, it
also prints Clippy lints. I don't think this is a good approach from a
UX perspective: Why is a random file necessary to print a help message?

This PR changes this behavior: Whenever a compiler callback
registers lints, it is assumed that these lints come from a plugin and
are printed without having to specify a Rust source file.

Fixes rust-lang/rust-clippy#6122

cc `@Manishearth` `@ebroto` for the Clippy changes.
2020-11-26 18:51:45 +00:00
..
callbacks.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
interface.rs Add method to get the register_lints function from the compiler 2020-11-24 10:37:14 +01:00
lib.rs Merge set_panic and set_print into set_output_capture. 2020-11-10 21:58:13 +01:00
passes.rs Validate use of parameters in naked functions 2020-11-25 00:00:00 +00:00
proc_macro_decls.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
queries.rs Move Steal to rustc_data_structures. 2020-11-14 01:30:56 +01:00
tests.rs TRACK '-Z polonius' flag 2020-11-24 20:08:54 -08:00
util.rs Move lev_distance to rustc_ast, make non-generic 2020-11-24 16:12:23 -08:00