Skip to content

Commit 2b53ec3

Browse files
authored
Rollup merge of #83392 - ehuss:w-help-edition, r=varkor
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.
2 parents 30db261 + 45583e5 commit 2b53ec3

File tree

1 file changed

+6
-1
lines changed
  • compiler/rustc_driver/src

1 file changed

+6
-1
lines changed

compiler/rustc_driver/src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,12 @@ Available lint options:
895895
let print_lints = |lints: Vec<&Lint>| {
896896
for lint in lints {
897897
let name = lint.name_lower().replace("_", "-");
898-
println!(" {} {:7.7} {}", padded(&name), lint.default_level.as_str(), lint.desc);
898+
println!(
899+
" {} {:7.7} {}",
900+
padded(&name),
901+
lint.default_level(sess.edition()).as_str(),
902+
lint.desc
903+
);
899904
}
900905
println!("\n");
901906
};

0 commit comments

Comments
 (0)