mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 21:23:20 +00:00
Give a better error when --theme is not a CSS file
Before: ``` error: invalid argument: "bacon.toml" ``` After: ``` error: invalid argument: "bacon.toml" | = help: arguments to --theme must be CSS files ```
This commit is contained in:
parent
a5029ac0ab
commit
29eb6860a8
@ -439,7 +439,9 @@ impl Options {
|
||||
return Err(1);
|
||||
}
|
||||
if theme_file.extension() != Some(OsStr::new("css")) {
|
||||
diag.struct_err(&format!("invalid argument: \"{}\"", theme_s)).emit();
|
||||
diag.struct_err(&format!("invalid argument: \"{}\"", theme_s))
|
||||
.help("arguments to --theme must have a .css extension")
|
||||
.emit();
|
||||
return Err(1);
|
||||
}
|
||||
let (success, ret) = theme::test_theme_against(&theme_file, &paths, &diag);
|
||||
|
3
src/test/rustdoc-ui/invalid-theme-name.rs
Normal file
3
src/test/rustdoc-ui/invalid-theme-name.rs
Normal file
@ -0,0 +1,3 @@
|
||||
// compile-flags:--theme {{src-base}}/invalid-theme-name.rs
|
||||
// error-pattern: invalid argument
|
||||
// error-pattern: must have a .css extension
|
4
src/test/rustdoc-ui/invalid-theme-name.stderr
Normal file
4
src/test/rustdoc-ui/invalid-theme-name.stderr
Normal file
@ -0,0 +1,4 @@
|
||||
error: invalid argument: "$DIR/invalid-theme-name.rs"
|
||||
|
|
||||
= help: arguments to --theme must have a .css extension
|
||||
|
@ -1909,8 +1909,7 @@ impl<'test> TestCx<'test> {
|
||||
} else {
|
||||
Command::new(&self.config.rustdoc_path.clone().expect("no rustdoc built yet"))
|
||||
};
|
||||
// FIXME Why is -L here?
|
||||
rustc.arg(input_file); //.arg("-L").arg(&self.config.build_base);
|
||||
rustc.arg(input_file);
|
||||
|
||||
// Use a single thread for efficiency and a deterministic error message order
|
||||
rustc.arg("-Zthreads=1");
|
||||
|
Loading…
Reference in New Issue
Block a user