]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_interface/src/interface.rs
Rollup merge of #91828 - oxalica:feat/waker-getters, r=dtolnay
[rust.git] / compiler / rustc_interface / src / interface.rs
index 3804e10030733309293866cc5383da930661a2d8..263435619590e1ba78a938f701318bd2f3d1b74d 100644 (file)
@@ -124,7 +124,16 @@ macro_rules! error {
                     Err(errs) => errs.into_iter().for_each(|mut err| err.cancel()),
                 }
 
-                error!(r#"expected `key` or `key="value"`"#);
+                // If the user tried to use a key="value" flag, but is missing the quotes, provide
+                // a hint about how to resolve this.
+                if s.contains("=") && !s.contains("=\"") && !s.ends_with("\"") {
+                    error!(concat!(
+                        r#"expected `key` or `key="value"`, ensure escaping is appropriate"#,
+                        r#" for your shell, try 'key="value"' or key=\"value\""#
+                    ));
+                } else {
+                    error!(r#"expected `key` or `key="value"`"#);
+                }
             })
             .collect::<CrateConfig>();
         cfg.into_iter().map(|(a, b)| (a.to_string(), b.map(|b| b.to_string()))).collect()