diff options
| author | bors <bors@rust-lang.org> | 2024-12-14 03:55:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-14 03:55:47 +0000 |
| commit | a1740a9c3568e856f6aa12d83e008d38c9749d4b (patch) | |
| tree | 9830a58a9a9a6f2b70c34a550e91e6fc80fe75e7 /compiler/rustc_driver_impl/src/lib.rs | |
| parent | 4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917 (diff) | |
| parent | 75e778991ec9d07bba422645c2a148829bf9d0f3 (diff) | |
| download | rust-a1740a9c3568e856f6aa12d83e008d38c9749d4b.tar.gz rust-a1740a9c3568e856f6aa12d83e008d38c9749d4b.zip | |
Auto merge of #134292 - matthiaskrgr:rollup-3kbjocl, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #134181 (Tweak multispan rendering to reduce output length) - #134209 (validate `--skip` and `--exclude` paths) - #134231 (rustdoc-search: fix mismatched path when parent re-exported twice) - #134236 (crashes: more tests v2) - #134240 (Only dist `llvm-objcopy` if llvm tools are enabled) - #134244 (rustc_borrowck: Stop suggesting the invalid syntax `&mut raw const`) - #134251 (A bunch of cleanups (part 2)) - #134256 (Use a more precise span in placeholder_type_error_diag) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_driver_impl/src/lib.rs')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index fe4e822ce0d..b80736f41ad 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -347,6 +347,8 @@ fn run_compiler( callbacks.config(&mut config); + let registered_lints = config.register_lints.is_some(); + interface::run_compiler(config, |compiler| { let sess = &compiler.sess; let codegen_backend = &*compiler.codegen_backend; @@ -362,7 +364,7 @@ fn run_compiler( // `--help`/`-Zhelp`/`-Chelp`. This is the earliest it can run, because // it must happen after lints are registered, during session creation. if sess.opts.describe_lints { - describe_lints(sess); + describe_lints(sess, registered_lints); return early_exit(); } @@ -980,7 +982,7 @@ the command line flag directly. } /// Write to stdout lint command options, together with a list of all available lints -pub fn describe_lints(sess: &Session) { +pub fn describe_lints(sess: &Session, registered_lints: bool) { safe_println!( " Available lint options: @@ -1084,7 +1086,7 @@ Available lint options: print_lint_groups(builtin_groups, true); - match (sess.registered_lints, loaded.len(), loaded_groups.len()) { + match (registered_lints, loaded.len(), loaded_groups.len()) { (false, 0, _) | (false, _, 0) => { safe_println!("Lint tools like Clippy can load additional lints and lint groups."); } |
