Skip to content

Commit 90330b5

Browse files
committed
Improve error message for cfg arguments.
This provides the user with a helpful error message in case a key="value" message was specified but couldn't be parsed.
1 parent 89b9f7b commit 90330b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_interface/src/interface.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String
124124
Err(errs) => errs.into_iter().for_each(|mut err| err.cancel()),
125125
}
126126

127-
error!(r#"expected `key` or `key="value"`"#);
127+
error!(concat!(
128+
r#"expected `key` or `key="value"`, ensure escaping is appropriate"#,
129+
r#" for your shell, try 'key="value"' or key=\"value\""#
130+
));
128131
})
129132
.collect::<CrateConfig>();
130133
cfg.into_iter().map(|(a, b)| (a.to_string(), b.map(|b| b.to_string()))).collect()

0 commit comments

Comments
 (0)