diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-make-fulldeps/rustdoc-themes/Makefile | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/command-line-register-lint-tool.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/lint/command-line-register-unknown-lint-tool.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/lint/command-line-register-unknown-lint-tool.stderr | 11 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-86895.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-86895.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/parser/recover-ref-dyn-mut.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/parser/recover-ref-dyn-mut.stderr | 15 |
8 files changed, 58 insertions, 1 deletions
diff --git a/src/test/run-make-fulldeps/rustdoc-themes/Makefile b/src/test/run-make-fulldeps/rustdoc-themes/Makefile index f5a471e66e5..f3d07b25c47 100644 --- a/src/test/run-make-fulldeps/rustdoc-themes/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-themes/Makefile @@ -5,6 +5,6 @@ OUTPUT_DIR := "$(TMPDIR)/rustdoc-themes" all: - cp $(S)/src/librustdoc/html/static/themes/light.css $(TMPDIR)/test.css + cp $(S)/src/librustdoc/html/static/css/themes/light.css $(TMPDIR)/test.css $(RUSTDOC) -o $(OUTPUT_DIR) foo.rs --theme $(TMPDIR)/test.css $(HTMLDOCCK) $(OUTPUT_DIR) foo.rs diff --git a/src/test/ui/lint/command-line-register-lint-tool.rs b/src/test/ui/lint/command-line-register-lint-tool.rs new file mode 100644 index 00000000000..d6e95fd3ec4 --- /dev/null +++ b/src/test/ui/lint/command-line-register-lint-tool.rs @@ -0,0 +1,7 @@ +// compile-flags: -A known_tool::foo +// check-pass + +#![feature(register_tool)] +#![register_tool(known_tool)] + +fn main() {} diff --git a/src/test/ui/lint/command-line-register-unknown-lint-tool.rs b/src/test/ui/lint/command-line-register-unknown-lint-tool.rs new file mode 100644 index 00000000000..59fc0200095 --- /dev/null +++ b/src/test/ui/lint/command-line-register-unknown-lint-tool.rs @@ -0,0 +1,4 @@ +// compile-flags: -A unknown_tool::foo +// error-pattern: unknown lint tool: `unknown_tool` + +fn main() {} diff --git a/src/test/ui/lint/command-line-register-unknown-lint-tool.stderr b/src/test/ui/lint/command-line-register-unknown-lint-tool.stderr new file mode 100644 index 00000000000..c9a2aff2137 --- /dev/null +++ b/src/test/ui/lint/command-line-register-unknown-lint-tool.stderr @@ -0,0 +1,11 @@ +error[E0602]: unknown lint tool: `unknown_tool` + | + = note: requested on the command line with `-A unknown_tool::foo` + +error[E0602]: unknown lint tool: `unknown_tool` + | + = note: requested on the command line with `-A unknown_tool::foo` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0602`. diff --git a/src/test/ui/parser/issue-86895.rs b/src/test/ui/parser/issue-86895.rs new file mode 100644 index 00000000000..4cd09843107 --- /dev/null +++ b/src/test/ui/parser/issue-86895.rs @@ -0,0 +1,3 @@ +const pub () {} +//~^ ERROR expected one of `async`, `extern`, `fn`, or `unsafe` +pub fn main() {} diff --git a/src/test/ui/parser/issue-86895.stderr b/src/test/ui/parser/issue-86895.stderr new file mode 100644 index 00000000000..575d857c0ed --- /dev/null +++ b/src/test/ui/parser/issue-86895.stderr @@ -0,0 +1,8 @@ +error: expected one of `async`, `extern`, `fn`, or `unsafe`, found keyword `pub` + --> $DIR/issue-86895.rs:1:7 + | +LL | const pub () {} + | ^^^ expected one of `async`, `extern`, `fn`, or `unsafe` + +error: aborting due to previous error + diff --git a/src/test/ui/parser/recover-ref-dyn-mut.rs b/src/test/ui/parser/recover-ref-dyn-mut.rs new file mode 100644 index 00000000000..3016275cc0f --- /dev/null +++ b/src/test/ui/parser/recover-ref-dyn-mut.rs @@ -0,0 +1,9 @@ +// Test that the parser detects `&dyn mut`, offers a help message, and +// recovers. + +fn main() { + let r: &dyn mut Trait; + //~^ ERROR: `mut` must precede `dyn` + //~| HELP: place `mut` before `dyn` + //~| ERROR: cannot find trait `Trait` in this scope [E0405] +} diff --git a/src/test/ui/parser/recover-ref-dyn-mut.stderr b/src/test/ui/parser/recover-ref-dyn-mut.stderr new file mode 100644 index 00000000000..c048c8ea1b0 --- /dev/null +++ b/src/test/ui/parser/recover-ref-dyn-mut.stderr @@ -0,0 +1,15 @@ +error: `mut` must precede `dyn` + --> $DIR/recover-ref-dyn-mut.rs:5:12 + | +LL | let r: &dyn mut Trait; + | ^^^^^^^^ help: place `mut` before `dyn`: `&mut dyn` + +error[E0405]: cannot find trait `Trait` in this scope + --> $DIR/recover-ref-dyn-mut.rs:5:21 + | +LL | let r: &dyn mut Trait; + | ^^^^^ not found in this scope + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0405`. |
