Skip to content

Commit

Permalink
Rollup merge of #83392 - ehuss:w-help-edition, r=varkor
Browse files Browse the repository at this point in the history
Change `-W help` to display edition level.

`-W help` was not honoring the `--edition` flag when displaying the default lint level. It was using the edition for sorting, but not for the final display.

This isn't important right now as there aren't any edition-specific lint levels. Also, the `declare_lint` macro is broken and doesn't even allow setting them right now. However, I figure it wouldn't hurt to fix this before I forget about it, in case edition-specific lints are ever used in the future.
  • Loading branch information
Dylan-DPC authored Mar 24, 2021
2 parents 30db261 + 45583e5 commit 2b53ec3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/rustc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,12 @@ Available lint options:
let print_lints = |lints: Vec<&Lint>| {
for lint in lints {
let name = lint.name_lower().replace("_", "-");
println!(" {} {:7.7} {}", padded(&name), lint.default_level.as_str(), lint.desc);
println!(
" {} {:7.7} {}",
padded(&name),
lint.default_level(sess.edition()).as_str(),
lint.desc
);
}
println!("\n");
};
Expand Down

0 comments on commit 2b53ec3

Please sign in to comment.