summary refs log tree commit diff
path: root/tests/ui/parser/removed-syntax
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2024-01-17 15:59:04 +0000
committerclubby789 <jamie@hill-daniel.co.uk>2024-01-17 22:17:44 +0000
commit3f7c7842e6dd0dfc713c52fe7ffd24cd6a54fa87 (patch)
tree643dc3c82c550587a0c641f16751aead17dae071 /tests/ui/parser/removed-syntax
parentb9ebeee4da258f1ed8bb93f0273180572a839058 (diff)
downloadrust-3f7c7842e6dd0dfc713c52fe7ffd24cd6a54fa87.tar.gz
rust-3f7c7842e6dd0dfc713c52fe7ffd24cd6a54fa87.zip
Move `removed-syntax` tests to their own directory
Diffstat (limited to 'tests/ui/parser/removed-syntax')
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-box.fixed14
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-box.rs14
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-box.stderr57
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-closure-lifetime.rs2
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-closure-lifetime.stderr13
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-enum-newtype.rs1
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-enum-newtype.stderr10
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-field-let-2.rs12
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr33
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-field-let.rs6
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr14
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-field-semicolon.rs6
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-field-semicolon.stderr10
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-fixed-vec.rs1
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-fixed-vec.stderr8
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.rs4
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.stderr14
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-mode.rs4
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-mode.stderr8
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-mut-vec-expr.rs3
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-mut-vec-expr.stderr8
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-mut-vec-ty.rs1
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-mut-vec-ty.stderr8
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-ptr-lifetime.rs1
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-ptr-lifetime.stderr8
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-record.rs1
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-record.stderr8
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-static-fn.rs10
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-static-fn.stderr25
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-expr.rs3
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-expr.stderr8
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-ty.rs2
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-ty.stderr8
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-with-1.rs10
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-with-1.stderr11
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-with-2.rs11
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-with-2.stderr18
37 files changed, 375 insertions, 0 deletions
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-box.fixed b/tests/ui/parser/removed-syntax/removed-syntax-box.fixed
new file mode 100644
index 00000000000..09d1304b775
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-box.fixed
@@ -0,0 +1,14 @@
+// run-rustfix
+
+fn main() {
+    #[allow(dead_code)]
+    struct T {
+        a: u8,
+        b: u8,
+    }
+    let _ = Box::new(()); //~ ERROR `box_syntax` has been removed
+    let _ = Box::new(1); //~ ERROR `box_syntax` has been removed
+    let _ = Box::new(T { a: 12, b: 18 }); //~ ERROR `box_syntax` has been removed
+    let _ = Box::new([5; 30]); //~ ERROR `box_syntax` has been removed
+    let _: Box<()> = Box::new(()); //~ ERROR `box_syntax` has been removed
+}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-box.rs b/tests/ui/parser/removed-syntax/removed-syntax-box.rs
new file mode 100644
index 00000000000..1f5061b02c7
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-box.rs
@@ -0,0 +1,14 @@
+// run-rustfix
+
+fn main() {
+    #[allow(dead_code)]
+    struct T {
+        a: u8,
+        b: u8,
+    }
+    let _ = box (); //~ ERROR `box_syntax` has been removed
+    let _ = box 1; //~ ERROR `box_syntax` has been removed
+    let _ = box T { a: 12, b: 18 }; //~ ERROR `box_syntax` has been removed
+    let _ = box [5; 30]; //~ ERROR `box_syntax` has been removed
+    let _: Box<()> = box (); //~ ERROR `box_syntax` has been removed
+}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-box.stderr b/tests/ui/parser/removed-syntax/removed-syntax-box.stderr
new file mode 100644
index 00000000000..46b891587d5
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-box.stderr
@@ -0,0 +1,57 @@
+error: `box_syntax` has been removed
+  --> $DIR/removed-syntax-box.rs:9:13
+   |
+LL |     let _ = box ();
+   |             ^^^^^^
+   |
+help: use `Box::new()` instead
+   |
+LL |     let _ = Box::new(());
+   |             ~~~~~~~~~~~~
+
+error: `box_syntax` has been removed
+  --> $DIR/removed-syntax-box.rs:10:13
+   |
+LL |     let _ = box 1;
+   |             ^^^^^
+   |
+help: use `Box::new()` instead
+   |
+LL |     let _ = Box::new(1);
+   |             ~~~~~~~~~~~
+
+error: `box_syntax` has been removed
+  --> $DIR/removed-syntax-box.rs:11:13
+   |
+LL |     let _ = box T { a: 12, b: 18 };
+   |             ^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `Box::new()` instead
+   |
+LL |     let _ = Box::new(T { a: 12, b: 18 });
+   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: `box_syntax` has been removed
+  --> $DIR/removed-syntax-box.rs:12:13
+   |
+LL |     let _ = box [5; 30];
+   |             ^^^^^^^^^^^
+   |
+help: use `Box::new()` instead
+   |
+LL |     let _ = Box::new([5; 30]);
+   |             ~~~~~~~~~~~~~~~~~
+
+error: `box_syntax` has been removed
+  --> $DIR/removed-syntax-box.rs:13:22
+   |
+LL |     let _: Box<()> = box ();
+   |                      ^^^^^^
+   |
+help: use `Box::new()` instead
+   |
+LL |     let _: Box<()> = Box::new(());
+   |                      ~~~~~~~~~~~~
+
+error: aborting due to 5 previous errors
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-closure-lifetime.rs b/tests/ui/parser/removed-syntax/removed-syntax-closure-lifetime.rs
new file mode 100644
index 00000000000..e807a179473
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-closure-lifetime.rs
@@ -0,0 +1,2 @@
+type closure = Box<lt/fn()>;
+//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `:`, `<`, `=`, or `>`, found `/`
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-closure-lifetime.stderr b/tests/ui/parser/removed-syntax/removed-syntax-closure-lifetime.stderr
new file mode 100644
index 00000000000..4c991d67ea7
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-closure-lifetime.stderr
@@ -0,0 +1,13 @@
+error: expected one of `!`, `(`, `+`, `,`, `::`, `:`, `<`, `=`, or `>`, found `/`
+  --> $DIR/removed-syntax-closure-lifetime.rs:1:22
+   |
+LL | type closure = Box<lt/fn()>;
+   |                      ^ expected one of 9 possible tokens
+   |
+help: you might have meant to end the type parameters here
+   |
+LL | type closure = Box<lt>/fn()>;
+   |                      +
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-enum-newtype.rs b/tests/ui/parser/removed-syntax/removed-syntax-enum-newtype.rs
new file mode 100644
index 00000000000..518f90b2b83
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-enum-newtype.rs
@@ -0,0 +1 @@
+enum e = isize; //~ ERROR expected one of `<`, `where`, or `{`, found `=`
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-enum-newtype.stderr b/tests/ui/parser/removed-syntax/removed-syntax-enum-newtype.stderr
new file mode 100644
index 00000000000..5b917e93853
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-enum-newtype.stderr
@@ -0,0 +1,10 @@
+error: expected one of `<`, `where`, or `{`, found `=`
+  --> $DIR/removed-syntax-enum-newtype.rs:1:8
+   |
+LL | enum e = isize;
+   |      - ^ expected one of `<`, `where`, or `{`
+   |      |
+   |      while parsing this enum
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.rs b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.rs
new file mode 100644
index 00000000000..7ff91b476ae
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.rs
@@ -0,0 +1,12 @@
+struct Foo {
+    let x: i32,
+    //~^ ERROR expected identifier, found keyword
+    let y: i32,
+    //~^ ERROR expected identifier, found keyword
+}
+
+fn main() {
+    let _ = Foo {
+        //~^ ERROR missing fields `x` and `y` in initializer of `Foo`
+    };
+}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr
new file mode 100644
index 00000000000..fda0919b9b6
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr
@@ -0,0 +1,33 @@
+error: expected identifier, found keyword `let`
+  --> $DIR/removed-syntax-field-let-2.rs:2:5
+   |
+LL |     let x: i32,
+   |     ^^^-
+   |     |
+   |     expected identifier, found keyword
+   |     help: remove this `let` keyword
+   |
+   = note: the `let` keyword is not allowed in `struct` fields
+   = note: see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information
+
+error: expected identifier, found keyword `let`
+  --> $DIR/removed-syntax-field-let-2.rs:4:5
+   |
+LL |     let y: i32,
+   |     ^^^-
+   |     |
+   |     expected identifier, found keyword
+   |     help: remove this `let` keyword
+   |
+   = note: the `let` keyword is not allowed in `struct` fields
+   = note: see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information
+
+error[E0063]: missing fields `x` and `y` in initializer of `Foo`
+  --> $DIR/removed-syntax-field-let-2.rs:9:13
+   |
+LL |     let _ = Foo {
+   |             ^^^ missing `x` and `y`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0063`.
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let.rs b/tests/ui/parser/removed-syntax/removed-syntax-field-let.rs
new file mode 100644
index 00000000000..6d64de296f1
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let.rs
@@ -0,0 +1,6 @@
+struct S {
+    let foo: (),
+    //~^  ERROR expected identifier, found keyword `let`
+}
+
+fn main() {}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr
new file mode 100644
index 00000000000..339d056e636
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr
@@ -0,0 +1,14 @@
+error: expected identifier, found keyword `let`
+  --> $DIR/removed-syntax-field-let.rs:2:5
+   |
+LL |     let foo: (),
+   |     ^^^-
+   |     |
+   |     expected identifier, found keyword
+   |     help: remove this `let` keyword
+   |
+   = note: the `let` keyword is not allowed in `struct` fields
+   = note: see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-semicolon.rs b/tests/ui/parser/removed-syntax/removed-syntax-field-semicolon.rs
new file mode 100644
index 00000000000..808f2a5cc38
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-field-semicolon.rs
@@ -0,0 +1,6 @@
+struct S {
+    bar: ();
+    //~^ ERROR struct fields are separated by `,`
+}
+
+fn main() {}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-semicolon.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-semicolon.stderr
new file mode 100644
index 00000000000..522912a9e1c
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-field-semicolon.stderr
@@ -0,0 +1,10 @@
+error: struct fields are separated by `,`
+  --> $DIR/removed-syntax-field-semicolon.rs:2:12
+   |
+LL | struct S {
+   |        - while parsing this struct
+LL |     bar: ();
+   |            ^ help: replace `;` with `,`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-fixed-vec.rs b/tests/ui/parser/removed-syntax/removed-syntax-fixed-vec.rs
new file mode 100644
index 00000000000..560efecb91c
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-fixed-vec.rs
@@ -0,0 +1 @@
+type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*`
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-fixed-vec.stderr b/tests/ui/parser/removed-syntax/removed-syntax-fixed-vec.stderr
new file mode 100644
index 00000000000..5bc9c2ccf00
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-fixed-vec.stderr
@@ -0,0 +1,8 @@
+error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*`
+  --> $DIR/removed-syntax-fixed-vec.rs:1:17
+   |
+LL | type v = [isize * 3];
+   |                 ^ expected one of 7 possible tokens
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.rs b/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.rs
new file mode 100644
index 00000000000..d55a032d1f2
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.rs
@@ -0,0 +1,4 @@
+fn main() {
+    let x: fn~() = || (); //~ ERROR missing parameters for function definition
+    //~| ERROR expected one of `->`, `;`, or `=`, found `~`
+}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.stderr b/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.stderr
new file mode 100644
index 00000000000..0d377416700
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.stderr
@@ -0,0 +1,14 @@
+error: missing parameters for function definition
+  --> $DIR/removed-syntax-fn-sigil.rs:2:14
+   |
+LL |     let x: fn~() = || ();
+   |              ^ help: add a parameter list
+
+error: expected one of `->`, `;`, or `=`, found `~`
+  --> $DIR/removed-syntax-fn-sigil.rs:2:14
+   |
+LL |     let x: fn~() = || ();
+   |              ^ expected one of `->`, `;`, or `=`
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-mode.rs b/tests/ui/parser/removed-syntax/removed-syntax-mode.rs
new file mode 100644
index 00000000000..a438db3b0c1
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-mode.rs
@@ -0,0 +1,4 @@
+fn f(+x: isize) {}
+//~^ ERROR expected parameter name, found `+`
+
+fn main() {}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-mode.stderr b/tests/ui/parser/removed-syntax/removed-syntax-mode.stderr
new file mode 100644
index 00000000000..fd964c4b7f0
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-mode.stderr
@@ -0,0 +1,8 @@
+error: expected parameter name, found `+`
+  --> $DIR/removed-syntax-mode.rs:1:6
+   |
+LL | fn f(+x: isize) {}
+   |      ^ expected parameter name
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-expr.rs b/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-expr.rs
new file mode 100644
index 00000000000..2ee95db5a25
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-expr.rs
@@ -0,0 +1,3 @@
+fn main() {
+    let v = [mut 1, 2, 3, 4]; //~ ERROR expected expression, found keyword `mut`
+}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-expr.stderr b/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-expr.stderr
new file mode 100644
index 00000000000..a1aa1ae49e3
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-expr.stderr
@@ -0,0 +1,8 @@
+error: expected expression, found keyword `mut`
+  --> $DIR/removed-syntax-mut-vec-expr.rs:2:14
+   |
+LL |     let v = [mut 1, 2, 3, 4];
+   |              ^^^ expected expression
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-ty.rs b/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-ty.rs
new file mode 100644
index 00000000000..923a7ea37a4
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-ty.rs
@@ -0,0 +1 @@
+type v = [mut isize]; //~ ERROR expected type, found keyword `mut`
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-ty.stderr b/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-ty.stderr
new file mode 100644
index 00000000000..beaae7cddaa
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-mut-vec-ty.stderr
@@ -0,0 +1,8 @@
+error: expected type, found keyword `mut`
+  --> $DIR/removed-syntax-mut-vec-ty.rs:1:11
+   |
+LL | type v = [mut isize];
+   |           ^^^ expected type
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-ptr-lifetime.rs b/tests/ui/parser/removed-syntax/removed-syntax-ptr-lifetime.rs
new file mode 100644
index 00000000000..cc69af44a13
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-ptr-lifetime.rs
@@ -0,0 +1 @@
+type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, `;`, `<`, or `where`, found `/`
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-ptr-lifetime.stderr b/tests/ui/parser/removed-syntax/removed-syntax-ptr-lifetime.stderr
new file mode 100644
index 00000000000..5c74efffabf
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-ptr-lifetime.stderr
@@ -0,0 +1,8 @@
+error: expected one of `!`, `(`, `::`, `;`, `<`, or `where`, found `/`
+  --> $DIR/removed-syntax-ptr-lifetime.rs:1:22
+   |
+LL | type bptr = &lifetime/isize;
+   |                      ^ expected one of `!`, `(`, `::`, `;`, `<`, or `where`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-record.rs b/tests/ui/parser/removed-syntax/removed-syntax-record.rs
new file mode 100644
index 00000000000..d1d91c8f7dc
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-record.rs
@@ -0,0 +1 @@
+type t = { f: () }; //~ ERROR expected type, found `{`
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-record.stderr b/tests/ui/parser/removed-syntax/removed-syntax-record.stderr
new file mode 100644
index 00000000000..dbf09f1c75b
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-record.stderr
@@ -0,0 +1,8 @@
+error: expected type, found `{`
+  --> $DIR/removed-syntax-record.rs:1:10
+   |
+LL | type t = { f: () };
+   |          ^ expected type
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-static-fn.rs b/tests/ui/parser/removed-syntax/removed-syntax-static-fn.rs
new file mode 100644
index 00000000000..cd643b874db
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-static-fn.rs
@@ -0,0 +1,10 @@
+struct S;
+
+impl S {
+    static fn f() {}
+    //~^ ERROR expected identifier, found keyword `fn`
+    //~| ERROR expected one of `:`, `;`, or `=`
+    //~| ERROR missing type for `static` item
+}
+
+fn main() {}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-static-fn.stderr b/tests/ui/parser/removed-syntax/removed-syntax-static-fn.stderr
new file mode 100644
index 00000000000..52e0658949d
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-static-fn.stderr
@@ -0,0 +1,25 @@
+error: expected identifier, found keyword `fn`
+  --> $DIR/removed-syntax-static-fn.rs:4:12
+   |
+LL |     static fn f() {}
+   |            ^^ expected identifier, found keyword
+
+error: expected one of `:`, `;`, or `=`, found `f`
+  --> $DIR/removed-syntax-static-fn.rs:4:15
+   |
+LL | impl S {
+   |        - while parsing this item list starting here
+LL |     static fn f() {}
+   |               ^ expected one of `:`, `;`, or `=`
+...
+LL | }
+   | - the item list ends here
+
+error: missing type for `static` item
+  --> $DIR/removed-syntax-static-fn.rs:4:14
+   |
+LL |     static fn f() {}
+   |              ^ help: provide a type for the item: `: <type>`
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-expr.rs b/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-expr.rs
new file mode 100644
index 00000000000..08ef4b43269
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-expr.rs
@@ -0,0 +1,3 @@
+fn main() {
+    let a_box = box mut 42; //~ ERROR expected expression, found keyword `mut`
+}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-expr.stderr b/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-expr.stderr
new file mode 100644
index 00000000000..7aaedad19d8
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-expr.stderr
@@ -0,0 +1,8 @@
+error: expected expression, found keyword `mut`
+  --> $DIR/removed-syntax-uniq-mut-expr.rs:2:21
+   |
+LL |     let a_box = box mut 42;
+   |                     ^^^ expected expression
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-ty.rs b/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-ty.rs
new file mode 100644
index 00000000000..a8dee5bbda4
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-ty.rs
@@ -0,0 +1,2 @@
+type mut_box = Box<mut isize>;
+//~^ ERROR expected one of `>`, a const expression, lifetime, or type, found keyword `mut`
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-ty.stderr b/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-ty.stderr
new file mode 100644
index 00000000000..5ae1f4f587e
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-uniq-mut-ty.stderr
@@ -0,0 +1,8 @@
+error: expected one of `>`, a const expression, lifetime, or type, found keyword `mut`
+  --> $DIR/removed-syntax-uniq-mut-ty.rs:1:20
+   |
+LL | type mut_box = Box<mut isize>;
+   |                    ^^^ expected one of `>`, a const expression, lifetime, or type
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-with-1.rs b/tests/ui/parser/removed-syntax/removed-syntax-with-1.rs
new file mode 100644
index 00000000000..2c1e152dcee
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-with-1.rs
@@ -0,0 +1,10 @@
+fn main() {
+    struct S {
+        foo: (),
+        bar: (),
+    }
+
+    let a = S { foo: (), bar: () };
+    let b = S { foo: () with a, bar: () };
+    //~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `with`
+}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-with-1.stderr b/tests/ui/parser/removed-syntax/removed-syntax-with-1.stderr
new file mode 100644
index 00000000000..78042678a87
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-with-1.stderr
@@ -0,0 +1,11 @@
+error: expected one of `,`, `.`, `?`, `}`, or an operator, found `with`
+  --> $DIR/removed-syntax-with-1.rs:8:25
+   |
+LL |     let b = S { foo: () with a, bar: () };
+   |             -          -^^^^ expected one of `,`, `.`, `?`, `}`, or an operator
+   |             |          |
+   |             |          help: try adding a comma: `,`
+   |             while parsing this struct
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-with-2.rs b/tests/ui/parser/removed-syntax/removed-syntax-with-2.rs
new file mode 100644
index 00000000000..451057c66a1
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-with-2.rs
@@ -0,0 +1,11 @@
+fn main() {
+    struct S {
+        foo: (),
+        bar: (),
+    }
+
+    let a = S { foo: (), bar: () };
+    let b = S { foo: (), with a };
+    //~^ ERROR expected one of `,`, `:`, or `}`, found `a`
+    //~| ERROR missing field `bar` in initializer of `S`
+}
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-with-2.stderr b/tests/ui/parser/removed-syntax/removed-syntax-with-2.stderr
new file mode 100644
index 00000000000..e75c5bcd643
--- /dev/null
+++ b/tests/ui/parser/removed-syntax/removed-syntax-with-2.stderr
@@ -0,0 +1,18 @@
+error: expected one of `,`, `:`, or `}`, found `a`
+  --> $DIR/removed-syntax-with-2.rs:8:31
+   |
+LL |     let b = S { foo: (), with a };
+   |             -            ---- ^ expected one of `,`, `:`, or `}`
+   |             |            |
+   |             |            while parsing this struct field
+   |             while parsing this struct
+
+error[E0063]: missing field `bar` in initializer of `S`
+  --> $DIR/removed-syntax-with-2.rs:8:13
+   |
+LL |     let b = S { foo: (), with a };
+   |             ^ missing `bar`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0063`.