about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/rustdoc-output-path/Makefile4
-rw-r--r--tests/run-make/rustdoc-output-path/rmake.rs9
-rw-r--r--tests/ui/abi/debug.stderr4
-rw-r--r--tests/ui/attributes/nonterminal-expansion.rs2
-rw-r--r--tests/ui/attributes/nonterminal-expansion.stderr2
-rw-r--r--tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs4
-rw-r--r--tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr4
-rw-r--r--tests/ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.stderr2
-rw-r--r--tests/ui/parser/attribute/attr-bad-meta-4.rs9
-rw-r--r--tests/ui/parser/attribute/attr-bad-meta-4.stderr20
-rw-r--r--tests/ui/parser/attribute/attr-unquoted-ident.fixed17
-rw-r--r--tests/ui/parser/attribute/attr-unquoted-ident.rs14
-rw-r--r--tests/ui/parser/attribute/attr-unquoted-ident.stderr21
13 files changed, 70 insertions, 42 deletions
diff --git a/tests/run-make/rustdoc-output-path/Makefile b/tests/run-make/rustdoc-output-path/Makefile
deleted file mode 100644
index 8f5cda9e56e..00000000000
--- a/tests/run-make/rustdoc-output-path/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../tools.mk
-
-all:
-	$(RUSTDOC) -o "$(TMPDIR)/foo/bar/doc" foo.rs
diff --git a/tests/run-make/rustdoc-output-path/rmake.rs b/tests/run-make/rustdoc-output-path/rmake.rs
new file mode 100644
index 00000000000..74fb0a56ac6
--- /dev/null
+++ b/tests/run-make/rustdoc-output-path/rmake.rs
@@ -0,0 +1,9 @@
+// Checks that if the output folder doesn't exist, rustdoc will create it.
+
+use run_make_support::{rustdoc, tmp_dir};
+
+fn main() {
+    let out_dir = tmp_dir().join("foo/bar/doc");
+    rustdoc().input("foo.rs").output(&out_dir).run();
+    assert!(out_dir.exists());
+}
diff --git a/tests/ui/abi/debug.stderr b/tests/ui/abi/debug.stderr
index 00fc7d1ece1..7365839da89 100644
--- a/tests/ui/abi/debug.stderr
+++ b/tests/ui/abi/debug.stderr
@@ -576,7 +576,9 @@ error: ABIs are not compatible
                            },
                            abi: Scalar(
                                Initialized {
-                                   value: F32,
+                                   value: Float(
+                                       F32,
+                                   ),
                                    valid_range: $FULL,
                                },
                            ),
diff --git a/tests/ui/attributes/nonterminal-expansion.rs b/tests/ui/attributes/nonterminal-expansion.rs
index 6db7aea0745..1b2e92a3170 100644
--- a/tests/ui/attributes/nonterminal-expansion.rs
+++ b/tests/ui/attributes/nonterminal-expansion.rs
@@ -5,7 +5,7 @@
 macro_rules! pass_nonterminal {
     ($n:expr) => {
         #[repr(align($n))]
-        //~^ ERROR expected unsuffixed literal or identifier, found `n!()`
+        //~^ ERROR expected unsuffixed literal, found `n!()`
         struct S;
     };
 }
diff --git a/tests/ui/attributes/nonterminal-expansion.stderr b/tests/ui/attributes/nonterminal-expansion.stderr
index 78541495b32..b640575d17d 100644
--- a/tests/ui/attributes/nonterminal-expansion.stderr
+++ b/tests/ui/attributes/nonterminal-expansion.stderr
@@ -1,4 +1,4 @@
-error: expected unsuffixed literal or identifier, found `n!()`
+error: expected unsuffixed literal, found `n!()`
   --> $DIR/nonterminal-expansion.rs:7:22
    |
 LL |         #[repr(align($n))]
diff --git a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs
index 408eaffccf7..d8852812492 100644
--- a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs
+++ b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs
@@ -28,8 +28,8 @@ struct S9;
 macro_rules! generate_s10 {
     ($expr: expr) => {
         #[cfg(feature = $expr)]
-        //~^ ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")`
-        //~| ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")`
+        //~^ ERROR expected unsuffixed literal, found `concat!("nonexistent")`
+        //~| ERROR expected unsuffixed literal, found `concat!("nonexistent")`
         struct S10;
     }
 }
diff --git a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
index 12557ff6360..3dd0823389c 100644
--- a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
+++ b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
@@ -54,7 +54,7 @@ LL | #[cfg(a = b"hi")]
    |           |
    |           help: consider removing the prefix
 
-error: expected unsuffixed literal or identifier, found `concat!("nonexistent")`
+error: expected unsuffixed literal, found `concat!("nonexistent")`
   --> $DIR/cfg-attr-syntax-validation.rs:30:25
    |
 LL |         #[cfg(feature = $expr)]
@@ -65,7 +65,7 @@ LL | generate_s10!(concat!("nonexistent"));
    |
    = note: this error originates in the macro `generate_s10` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: expected unsuffixed literal or identifier, found `concat!("nonexistent")`
+error: expected unsuffixed literal, found `concat!("nonexistent")`
   --> $DIR/cfg-attr-syntax-validation.rs:30:25
    |
 LL |         #[cfg(feature = $expr)]
diff --git a/tests/ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.stderr b/tests/ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.stderr
index 078c766deed..a030da5068c 100644
--- a/tests/ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.stderr
+++ b/tests/ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.stderr
@@ -4,7 +4,7 @@ error: expected unsuffixed literal, found `test`
 LL | #[deprecated(note = test)]
    |                     ^^^^
    |
-help: surround the identifier with quotation marks to parse it as a string
+help: surround the identifier with quotation marks to make it into a string literal
    |
 LL | #[deprecated(note = "test")]
    |                     +    +
diff --git a/tests/ui/parser/attribute/attr-bad-meta-4.rs b/tests/ui/parser/attribute/attr-bad-meta-4.rs
index cedbd1d6686..2a69ae5ac06 100644
--- a/tests/ui/parser/attribute/attr-bad-meta-4.rs
+++ b/tests/ui/parser/attribute/attr-bad-meta-4.rs
@@ -1,12 +1,17 @@
 macro_rules! mac {
     ($attr_item: meta) => {
         #[cfg($attr_item)]
-        //~^ ERROR expected unsuffixed literal or identifier, found `an(arbitrary token stream)`
-        //~| ERROR expected unsuffixed literal or identifier, found `an(arbitrary token stream)`
+        //~^ ERROR expected unsuffixed literal, found `an(arbitrary token stream)`
+        //~| ERROR expected unsuffixed literal, found `an(arbitrary token stream)`
         struct S;
     }
 }
 
 mac!(an(arbitrary token stream));
 
+#[cfg(feature = -1)]
+//~^ ERROR expected unsuffixed literal, found `-`
+//~| ERROR expected unsuffixed literal, found `-`
+fn handler() {}
+
 fn main() {}
diff --git a/tests/ui/parser/attribute/attr-bad-meta-4.stderr b/tests/ui/parser/attribute/attr-bad-meta-4.stderr
index a543bcb692e..192be28db3f 100644
--- a/tests/ui/parser/attribute/attr-bad-meta-4.stderr
+++ b/tests/ui/parser/attribute/attr-bad-meta-4.stderr
@@ -1,4 +1,10 @@
-error: expected unsuffixed literal or identifier, found `an(arbitrary token stream)`
+error: expected unsuffixed literal, found `-`
+  --> $DIR/attr-bad-meta-4.rs:12:17
+   |
+LL | #[cfg(feature = -1)]
+   |                 ^
+
+error: expected unsuffixed literal, found `an(arbitrary token stream)`
   --> $DIR/attr-bad-meta-4.rs:3:15
    |
 LL |         #[cfg($attr_item)]
@@ -9,7 +15,7 @@ LL | mac!(an(arbitrary token stream));
    |
    = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: expected unsuffixed literal or identifier, found `an(arbitrary token stream)`
+error: expected unsuffixed literal, found `an(arbitrary token stream)`
   --> $DIR/attr-bad-meta-4.rs:3:15
    |
 LL |         #[cfg($attr_item)]
@@ -21,5 +27,13 @@ LL | mac!(an(arbitrary token stream));
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
    = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 2 previous errors
+error: expected unsuffixed literal, found `-`
+  --> $DIR/attr-bad-meta-4.rs:12:17
+   |
+LL | #[cfg(feature = -1)]
+   |                 ^
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 4 previous errors
 
diff --git a/tests/ui/parser/attribute/attr-unquoted-ident.fixed b/tests/ui/parser/attribute/attr-unquoted-ident.fixed
deleted file mode 100644
index bc861ef69fb..00000000000
--- a/tests/ui/parser/attribute/attr-unquoted-ident.fixed
+++ /dev/null
@@ -1,17 +0,0 @@
-//@ compile-flags: -Zdeduplicate-diagnostics=yes
-//@ run-rustfix
-
-#![allow(unexpected_cfgs)]
-
-fn main() {
-    #[cfg(key="foo")]
-    //~^ ERROR expected unsuffixed literal, found `foo`
-    //~| HELP surround the identifier with quotation marks to parse it as a string
-    println!();
-    #[cfg(key="bar")]
-    println!();
-    #[cfg(key="foo bar baz")]
-    //~^ ERROR expected unsuffixed literal, found `foo`
-    //~| HELP surround the identifier with quotation marks to parse it as a string
-    println!();
-}
diff --git a/tests/ui/parser/attribute/attr-unquoted-ident.rs b/tests/ui/parser/attribute/attr-unquoted-ident.rs
index 8bdb8605ebb..5b15b8d69fc 100644
--- a/tests/ui/parser/attribute/attr-unquoted-ident.rs
+++ b/tests/ui/parser/attribute/attr-unquoted-ident.rs
@@ -1,17 +1,25 @@
 //@ compile-flags: -Zdeduplicate-diagnostics=yes
-//@ run-rustfix
 
 #![allow(unexpected_cfgs)]
 
 fn main() {
     #[cfg(key=foo)]
     //~^ ERROR expected unsuffixed literal, found `foo`
-    //~| HELP surround the identifier with quotation marks to parse it as a string
+    //~| HELP surround the identifier with quotation marks to make it into a string literal
     println!();
     #[cfg(key="bar")]
     println!();
     #[cfg(key=foo bar baz)]
     //~^ ERROR expected unsuffixed literal, found `foo`
-    //~| HELP surround the identifier with quotation marks to parse it as a string
+    //~| HELP surround the identifier with quotation marks to make it into a string literal
     println!();
 }
+
+// Don't suggest surrounding `$name` or `nickname` with quotes:
+
+macro_rules! make {
+    ($name:ident) => { #[doc(alias = $name)] pub struct S; }
+    //~^ ERROR expected unsuffixed literal, found `nickname`
+}
+
+make!(nickname); //~ NOTE in this expansion
diff --git a/tests/ui/parser/attribute/attr-unquoted-ident.stderr b/tests/ui/parser/attribute/attr-unquoted-ident.stderr
index 99484a51110..e0f99459c44 100644
--- a/tests/ui/parser/attribute/attr-unquoted-ident.stderr
+++ b/tests/ui/parser/attribute/attr-unquoted-ident.stderr
@@ -1,24 +1,35 @@
 error: expected unsuffixed literal, found `foo`
-  --> $DIR/attr-unquoted-ident.rs:7:15
+  --> $DIR/attr-unquoted-ident.rs:6:15
    |
 LL |     #[cfg(key=foo)]
    |               ^^^
    |
-help: surround the identifier with quotation marks to parse it as a string
+help: surround the identifier with quotation marks to make it into a string literal
    |
 LL |     #[cfg(key="foo")]
    |               +   +
 
 error: expected unsuffixed literal, found `foo`
-  --> $DIR/attr-unquoted-ident.rs:13:15
+  --> $DIR/attr-unquoted-ident.rs:12:15
    |
 LL |     #[cfg(key=foo bar baz)]
    |               ^^^
    |
-help: surround the identifier with quotation marks to parse it as a string
+help: surround the identifier with quotation marks to make it into a string literal
    |
 LL |     #[cfg(key="foo bar baz")]
    |               +           +
 
-error: aborting due to 2 previous errors
+error: expected unsuffixed literal, found `nickname`
+  --> $DIR/attr-unquoted-ident.rs:21:38
+   |
+LL |     ($name:ident) => { #[doc(alias = $name)] pub struct S; }
+   |                                      ^^^^^
+...
+LL | make!(nickname);
+   | --------------- in this macro invocation
+   |
+   = note: this error originates in the macro `make` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 3 previous errors