about summary refs log tree commit diff
path: root/src/test/ui/parser/macro
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/ui/parser/macro
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'src/test/ui/parser/macro')
-rw-r--r--src/test/ui/parser/macro/bad-macro-argument.rs4
-rw-r--r--src/test/ui/parser/macro/bad-macro-argument.stderr8
-rw-r--r--src/test/ui/parser/macro/issue-33569.rs12
-rw-r--r--src/test/ui/parser/macro/issue-33569.stderr30
-rw-r--r--src/test/ui/parser/macro/issue-37113.rs11
-rw-r--r--src/test/ui/parser/macro/issue-37113.stderr16
-rw-r--r--src/test/ui/parser/macro/issue-37234.rs9
-rw-r--r--src/test/ui/parser/macro/issue-37234.stderr13
-rw-r--r--src/test/ui/parser/macro/literals-are-validated-before-expansion.rs10
-rw-r--r--src/test/ui/parser/macro/literals-are-validated-before-expansion.stderr18
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-1.rs9
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-1.stderr20
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-2.rs9
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-2.stderr20
-rw-r--r--src/test/ui/parser/macro/macro-incomplete-parse.rs27
-rw-r--r--src/test/ui/parser/macro/macro-incomplete-parse.stderr35
-rw-r--r--src/test/ui/parser/macro/macro-repeat.rs12
-rw-r--r--src/test/ui/parser/macro/macro-repeat.stderr14
-rw-r--r--src/test/ui/parser/macro/pub-item-macro.rs21
-rw-r--r--src/test/ui/parser/macro/pub-item-macro.stderr31
-rw-r--r--src/test/ui/parser/macro/trait-non-item-macros.rs13
-rw-r--r--src/test/ui/parser/macro/trait-non-item-macros.stderr22
-rw-r--r--src/test/ui/parser/macro/trait-object-macro-matcher.rs14
-rw-r--r--src/test/ui/parser/macro/trait-object-macro-matcher.stderr15
24 files changed, 0 insertions, 393 deletions
diff --git a/src/test/ui/parser/macro/bad-macro-argument.rs b/src/test/ui/parser/macro/bad-macro-argument.rs
deleted file mode 100644
index 4b6d2389065..00000000000
--- a/src/test/ui/parser/macro/bad-macro-argument.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-fn main() {
-    let message = "world";
-    println!("Hello, {}", message/); //~ ERROR expected expression
-}
diff --git a/src/test/ui/parser/macro/bad-macro-argument.stderr b/src/test/ui/parser/macro/bad-macro-argument.stderr
deleted file mode 100644
index 3cd8accb662..00000000000
--- a/src/test/ui/parser/macro/bad-macro-argument.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: expected expression, found end of macro arguments
-  --> $DIR/bad-macro-argument.rs:3:35
-   |
-LL |     println!("Hello, {}", message/);
-   |                                   ^ expected expression
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/macro/issue-33569.rs b/src/test/ui/parser/macro/issue-33569.rs
deleted file mode 100644
index 069d181e962..00000000000
--- a/src/test/ui/parser/macro/issue-33569.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-macro_rules! foo {
-    { $+ } => { //~ ERROR expected identifier, found `+`
-                //~^ ERROR missing fragment specifier
-                //~| ERROR missing fragment specifier
-                //~| WARN this was previously accepted
-        $(x)(y) //~ ERROR expected one of: `*`, `+`, or `?`
-    }
-}
-
-foo!();
-
-fn main() {}
diff --git a/src/test/ui/parser/macro/issue-33569.stderr b/src/test/ui/parser/macro/issue-33569.stderr
deleted file mode 100644
index 0dca090fb87..00000000000
--- a/src/test/ui/parser/macro/issue-33569.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-error: expected identifier, found `+`
-  --> $DIR/issue-33569.rs:2:8
-   |
-LL |     { $+ } => {
-   |        ^
-
-error: expected one of: `*`, `+`, or `?`
-  --> $DIR/issue-33569.rs:6:13
-   |
-LL |         $(x)(y)
-   |             ^^^
-
-error: missing fragment specifier
-  --> $DIR/issue-33569.rs:2:8
-   |
-LL |     { $+ } => {
-   |        ^
-
-error: missing fragment specifier
-  --> $DIR/issue-33569.rs:2:8
-   |
-LL |     { $+ } => {
-   |        ^
-   |
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-   = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
-   = note: `#[deny(missing_fragment_specifier)]` on by default
-
-error: aborting due to 4 previous errors
-
diff --git a/src/test/ui/parser/macro/issue-37113.rs b/src/test/ui/parser/macro/issue-37113.rs
deleted file mode 100644
index 0044aa5610f..00000000000
--- a/src/test/ui/parser/macro/issue-37113.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-macro_rules! test_macro {
-    ( $( $t:ty ),* $(),*) => {
-        enum SomeEnum {
-            $( $t, )* //~ ERROR expected identifier, found `String`
-        };
-    };
-}
-
-fn main() {
-    test_macro!(String,);
-}
diff --git a/src/test/ui/parser/macro/issue-37113.stderr b/src/test/ui/parser/macro/issue-37113.stderr
deleted file mode 100644
index da9e743a0b4..00000000000
--- a/src/test/ui/parser/macro/issue-37113.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error: expected identifier, found `String`
-  --> $DIR/issue-37113.rs:4:16
-   |
-LL |         enum SomeEnum {
-   |              -------- while parsing this enum
-LL |             $( $t, )*
-   |                ^^ expected identifier
-...
-LL |     test_macro!(String,);
-   |     -------------------- in this macro invocation
-   |
-   = help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
-   = note: this error originates in the macro `test_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/macro/issue-37234.rs b/src/test/ui/parser/macro/issue-37234.rs
deleted file mode 100644
index 4debc747905..00000000000
--- a/src/test/ui/parser/macro/issue-37234.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-macro_rules! failed {
-    () => {{
-        let x = 5 ""; //~ ERROR found `""`
-    }}
-}
-
-fn main() {
-    failed!();
-}
diff --git a/src/test/ui/parser/macro/issue-37234.stderr b/src/test/ui/parser/macro/issue-37234.stderr
deleted file mode 100644
index d7919620449..00000000000
--- a/src/test/ui/parser/macro/issue-37234.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error: expected one of `.`, `;`, `?`, `else`, or an operator, found `""`
-  --> $DIR/issue-37234.rs:3:19
-   |
-LL |         let x = 5 "";
-   |                   ^^ expected one of `.`, `;`, `?`, `else`, or an operator
-...
-LL |     failed!();
-   |     --------- in this macro invocation
-   |
-   = note: this error originates in the macro `failed` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/macro/literals-are-validated-before-expansion.rs b/src/test/ui/parser/macro/literals-are-validated-before-expansion.rs
deleted file mode 100644
index c3fc754b556..00000000000
--- a/src/test/ui/parser/macro/literals-are-validated-before-expansion.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-macro_rules! black_hole {
-    ($($tt:tt)*) => {}
-}
-
-fn main() {
-    black_hole! { '\u{FFFFFF}' }
-    //~^ ERROR: invalid unicode character escape
-    black_hole! { "this is surrogate: \u{DAAA}" }
-    //~^ ERROR: invalid unicode character escape
-}
diff --git a/src/test/ui/parser/macro/literals-are-validated-before-expansion.stderr b/src/test/ui/parser/macro/literals-are-validated-before-expansion.stderr
deleted file mode 100644
index e874f62497e..00000000000
--- a/src/test/ui/parser/macro/literals-are-validated-before-expansion.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: invalid unicode character escape
-  --> $DIR/literals-are-validated-before-expansion.rs:6:20
-   |
-LL |     black_hole! { '\u{FFFFFF}' }
-   |                    ^^^^^^^^^^ invalid escape
-   |
-   = help: unicode escape must be at most 10FFFF
-
-error: invalid unicode character escape
-  --> $DIR/literals-are-validated-before-expansion.rs:8:39
-   |
-LL |     black_hole! { "this is surrogate: \u{DAAA}" }
-   |                                       ^^^^^^^^ invalid escape
-   |
-   = help: unicode escape must not be a surrogate
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/parser/macro/macro-doc-comments-1.rs b/src/test/ui/parser/macro/macro-doc-comments-1.rs
deleted file mode 100644
index 8d8103bb1e0..00000000000
--- a/src/test/ui/parser/macro/macro-doc-comments-1.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-macro_rules! outer {
-    (#[$outer:meta]) => ()
-}
-
-outer! {
-    //! Inner
-} //~^ ERROR no rules expected the token `!`
-
-fn main() { }
diff --git a/src/test/ui/parser/macro/macro-doc-comments-1.stderr b/src/test/ui/parser/macro/macro-doc-comments-1.stderr
deleted file mode 100644
index eaeb62d2cfd..00000000000
--- a/src/test/ui/parser/macro/macro-doc-comments-1.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: no rules expected the token `!`
-  --> $DIR/macro-doc-comments-1.rs:6:5
-   |
-LL | macro_rules! outer {
-   | ------------------ when calling this macro
-...
-LL |     //! Inner
-   |     ^^^^^^^^^
-   |     |
-   |     no rules expected this token in macro call
-   |     inner doc comments expand to `#![doc = "..."]`, which is what this macro attempted to match
-   |
-note: while trying to match `[`
-  --> $DIR/macro-doc-comments-1.rs:2:7
-   |
-LL |     (#[$outer:meta]) => ()
-   |       ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/macro/macro-doc-comments-2.rs b/src/test/ui/parser/macro/macro-doc-comments-2.rs
deleted file mode 100644
index 8f33720ae80..00000000000
--- a/src/test/ui/parser/macro/macro-doc-comments-2.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-macro_rules! inner {
-    (#![$inner:meta]) => ()
-}
-
-inner! {
-    /// Outer
-} //~^ ERROR no rules expected the token `[`
-
-fn main() { }
diff --git a/src/test/ui/parser/macro/macro-doc-comments-2.stderr b/src/test/ui/parser/macro/macro-doc-comments-2.stderr
deleted file mode 100644
index 1dcd95f6fad..00000000000
--- a/src/test/ui/parser/macro/macro-doc-comments-2.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: no rules expected the token `[`
-  --> $DIR/macro-doc-comments-2.rs:6:5
-   |
-LL | macro_rules! inner {
-   | ------------------ when calling this macro
-...
-LL |     /// Outer
-   |     ^^^^^^^^^
-   |     |
-   |     no rules expected this token in macro call
-   |     outer doc comments expand to `#[doc = "..."]`, which is what this macro attempted to match
-   |
-note: while trying to match `!`
-  --> $DIR/macro-doc-comments-2.rs:2:7
-   |
-LL |     (#![$inner:meta]) => ()
-   |       ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/macro/macro-incomplete-parse.rs b/src/test/ui/parser/macro/macro-incomplete-parse.rs
deleted file mode 100644
index 544e4aa7b1b..00000000000
--- a/src/test/ui/parser/macro/macro-incomplete-parse.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-macro_rules! ignored_item {
-    () => {
-        fn foo() {}
-        fn bar() {}
-        , //~ ERROR macro expansion ignores token `,`
-    }
-}
-
-macro_rules! ignored_expr {
-    () => ( 1,  //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
-
-            2 )
-}
-
-macro_rules! ignored_pat {
-    () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
-}
-
-ignored_item!();
-
-fn main() {
-    ignored_expr!();
-    match 1 {
-        ignored_pat!() => (),
-        _ => (),
-    }
-}
diff --git a/src/test/ui/parser/macro/macro-incomplete-parse.stderr b/src/test/ui/parser/macro/macro-incomplete-parse.stderr
deleted file mode 100644
index 707417b725e..00000000000
--- a/src/test/ui/parser/macro/macro-incomplete-parse.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error: macro expansion ignores token `,` and any following
-  --> $DIR/macro-incomplete-parse.rs:5:9
-   |
-LL |         ,
-   |         ^
-...
-LL | ignored_item!();
-   | --------------- caused by the macro expansion here
-   |
-   = note: the usage of `ignored_item!` is likely invalid in item context
-
-error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
-  --> $DIR/macro-incomplete-parse.rs:10:14
-   |
-LL |     () => ( 1,
-   |              ^ expected one of `.`, `;`, `?`, `}`, or an operator
-...
-LL |     ignored_expr!();
-   |     --------------- in this macro invocation
-   |
-   = note: this error originates in the macro `ignored_expr` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: macro expansion ignores token `,` and any following
-  --> $DIR/macro-incomplete-parse.rs:16:14
-   |
-LL |     () => ( 1, 2 )
-   |              ^
-...
-LL |         ignored_pat!() => (),
-   |         -------------- caused by the macro expansion here
-   |
-   = note: the usage of `ignored_pat!` is likely invalid in pattern context
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/parser/macro/macro-repeat.rs b/src/test/ui/parser/macro/macro-repeat.rs
deleted file mode 100644
index 3ffbea217e7..00000000000
--- a/src/test/ui/parser/macro/macro-repeat.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-macro_rules! mac {
-    ( $($v:tt)* ) => {
-        $v
-        //~^ ERROR still repeating at this depth
-        //~| ERROR still repeating at this depth
-    };
-}
-
-fn main() {
-    mac!(0);
-    mac!(1);
-}
diff --git a/src/test/ui/parser/macro/macro-repeat.stderr b/src/test/ui/parser/macro/macro-repeat.stderr
deleted file mode 100644
index 63554b197b9..00000000000
--- a/src/test/ui/parser/macro/macro-repeat.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: variable 'v' is still repeating at this depth
-  --> $DIR/macro-repeat.rs:3:9
-   |
-LL |         $v
-   |         ^^
-
-error: variable 'v' is still repeating at this depth
-  --> $DIR/macro-repeat.rs:3:9
-   |
-LL |         $v
-   |         ^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/parser/macro/pub-item-macro.rs b/src/test/ui/parser/macro/pub-item-macro.rs
deleted file mode 100644
index f5f8a01e6a4..00000000000
--- a/src/test/ui/parser/macro/pub-item-macro.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Issue #14660
-
-macro_rules! priv_x {
-    () => {
-        static x: u32 = 0;
-    };
-}
-
-macro_rules! pub_x { () => {
-    pub priv_x!(); //~ ERROR can't qualify macro invocation with `pub`
-    //~^ HELP remove the visibility
-    //~| HELP try adjusting the macro to put `pub` inside the invocation
-}}
-
-mod foo {
-    pub_x!();
-}
-
-fn main() {
-    let y: u32 = foo::x; //~ ERROR static `x` is private
-}
diff --git a/src/test/ui/parser/macro/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr
deleted file mode 100644
index 9a2fffcced5..00000000000
--- a/src/test/ui/parser/macro/pub-item-macro.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error: can't qualify macro invocation with `pub`
-  --> $DIR/pub-item-macro.rs:10:5
-   |
-LL |     pub priv_x!();
-   |     ^^^ help: remove the visibility
-...
-LL |     pub_x!();
-   |     -------- in this macro invocation
-   |
-   = help: try adjusting the macro to put `pub` inside the invocation
-   = note: this error originates in the macro `pub_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0603]: static `x` is private
-  --> $DIR/pub-item-macro.rs:20:23
-   |
-LL |     let y: u32 = foo::x;
-   |                       ^ private static
-   |
-note: the static `x` is defined here
-  --> $DIR/pub-item-macro.rs:5:9
-   |
-LL |         static x: u32 = 0;
-   |         ^^^^^^^^^^^^^^^^^^
-...
-LL |     pub_x!();
-   |     -------- in this macro invocation
-   = note: this error originates in the macro `priv_x` which comes from the expansion of the macro `pub_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0603`.
diff --git a/src/test/ui/parser/macro/trait-non-item-macros.rs b/src/test/ui/parser/macro/trait-non-item-macros.rs
deleted file mode 100644
index 97fb564bf64..00000000000
--- a/src/test/ui/parser/macro/trait-non-item-macros.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-macro_rules! bah {
-    ($a:expr) => {
-        $a
-    }; //~^ ERROR macro expansion ignores token `2` and any following
-}
-
-trait Bar {
-    bah!(2);
-}
-
-fn main() {
-    let _recovery_witness: () = 0; //~ ERROR mismatched types
-}
diff --git a/src/test/ui/parser/macro/trait-non-item-macros.stderr b/src/test/ui/parser/macro/trait-non-item-macros.stderr
deleted file mode 100644
index db20e6b24aa..00000000000
--- a/src/test/ui/parser/macro/trait-non-item-macros.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error: macro expansion ignores token `2` and any following
-  --> $DIR/trait-non-item-macros.rs:3:9
-   |
-LL |         $a
-   |         ^^
-...
-LL |     bah!(2);
-   |     ------- caused by the macro expansion here
-   |
-   = note: the usage of `bah!` is likely invalid in trait item context
-
-error[E0308]: mismatched types
-  --> $DIR/trait-non-item-macros.rs:12:33
-   |
-LL |     let _recovery_witness: () = 0;
-   |                            --   ^ expected `()`, found integer
-   |                            |
-   |                            expected due to this
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/parser/macro/trait-object-macro-matcher.rs b/src/test/ui/parser/macro/trait-object-macro-matcher.rs
deleted file mode 100644
index 560195977d0..00000000000
--- a/src/test/ui/parser/macro/trait-object-macro-matcher.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// A single lifetime is not parsed as a type.
-// `ty` matcher in particular doesn't accept a single lifetime
-
-macro_rules! m {
-    ($t: ty) => {
-        let _: $t;
-    };
-}
-
-fn main() {
-    m!('static);
-    //~^ ERROR lifetime in trait object type must be followed by `+`
-    //~| ERROR at least one trait is required for an object type
-}
diff --git a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr
deleted file mode 100644
index 40082564bad..00000000000
--- a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: lifetime in trait object type must be followed by `+`
-  --> $DIR/trait-object-macro-matcher.rs:11:8
-   |
-LL |     m!('static);
-   |        ^^^^^^^
-
-error[E0224]: at least one trait is required for an object type
-  --> $DIR/trait-object-macro-matcher.rs:11:8
-   |
-LL |     m!('static);
-   |        ^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0224`.