about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-14 03:54:35 +0100
committerGitHub <noreply@github.com>2024-12-14 03:54:35 +0100
commit87bbbcd1bbdd348d2068dbf5683eb7fbfb908079 (patch)
treea442a5321679f806e0bf4fc70b29f17e809df35e /src
parent34e607594b41942903cce31050d1b6b2b8ca948c (diff)
parent3198496385cd8fdd89818e0bf14bacd8db6292d9 (diff)
downloadrust-87bbbcd1bbdd348d2068dbf5683eb7fbfb908079.tar.gz
rust-87bbbcd1bbdd348d2068dbf5683eb7fbfb908079.zip
Rollup merge of #134251 - bjorn3:various_cleanups2, r=oli-obk
A bunch of cleanups (part 2)

Just like https://github.com/rust-lang/rust/pull/133567 these were all found while looking at the respective code, but are not blocking any other changes I want to make in the short term.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/lib.rs4
-rw-r--r--src/tools/miri/src/helpers.rs5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index a384c286039..5d82b8e309a 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -846,11 +846,13 @@ fn main_args(
 
     let config = core::create_config(input, options, &render_options, using_internal_features);
 
+    let registered_lints = config.register_lints.is_some();
+
     interface::run_compiler(config, |compiler| {
         let sess = &compiler.sess;
 
         if sess.opts.describe_lints {
-            rustc_driver::describe_lints(sess);
+            rustc_driver::describe_lints(sess, registered_lints);
             return;
         }
 
diff --git a/src/tools/miri/src/helpers.rs b/src/tools/miri/src/helpers.rs
index b57ce4e070c..1f7c60ad1bd 100644
--- a/src/tools/miri/src/helpers.rs
+++ b/src/tools/miri/src/helpers.rs
@@ -149,10 +149,9 @@ pub fn iter_exported_symbols<'tcx>(
     let dependency_formats = tcx.dependency_formats(());
     // Find the dependencies of the executable we are running.
     let dependency_format = dependency_formats
-        .iter()
-        .find(|(crate_type, _)| *crate_type == CrateType::Executable)
+        .get(&CrateType::Executable)
         .expect("interpreting a non-executable crate");
-    for cnum in dependency_format.1.iter().enumerate().filter_map(|(num, &linkage)| {
+    for cnum in dependency_format.iter().enumerate().filter_map(|(num, &linkage)| {
         // We add 1 to the number because that's what rustc also does everywhere it
         // calls `CrateNum::new`...
         #[expect(clippy::arithmetic_side_effects)]