about summary refs log tree commit diff
path: root/compiler/rustc_session
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-18 04:27:51 +0200
committerGitHub <noreply@github.com>2025-07-18 04:27:51 +0200
commit26f5936cf9f2d08be333201138b4f644dc545ecb (patch)
tree1f1c5b69133328267cfece9a41762713d78086da /compiler/rustc_session
parentaccf61dd42548bd5ec61d43f246b3eb499e980dd (diff)
parentaf39c0c57cb23678daaeb75ea729edd71aba14b8 (diff)
downloadrust-26f5936cf9f2d08be333201138b4f644dc545ecb.tar.gz
rust-26f5936cf9f2d08be333201138b4f644dc545ecb.zip
Rollup merge of #143719 - xizheyin:142812-1, r=jieyouxu
Emit warning when there is no space between `-o` and arg

Closes rust-lang/rust#142812

`getopt` doesn't seem to have an API to check this, so we have to check the args manually.

r? compiler
Diffstat (limited to 'compiler/rustc_session')
-rw-r--r--compiler/rustc_session/src/config.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index a91e2140fd4..d6215e1de04 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -1708,6 +1708,11 @@ impl RustcOptGroup {
             OptionKind::FlagMulti => options.optflagmulti(short_name, long_name, desc),
         };
     }
+
+    /// This is for diagnostics-only.
+    pub fn long_name(&self) -> &str {
+        self.long_name
+    }
 }
 
 pub fn make_opt(