about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/bad-fn-ptr-qualifier.fixed26
-rw-r--r--src/test/ui/parser/bad-fn-ptr-qualifier.rs26
-rw-r--r--src/test/ui/parser/bad-fn-ptr-qualifier.stderr146
-rw-r--r--src/test/ui/parser/if-in-in.fixed7
-rw-r--r--src/test/ui/parser/if-in-in.rs2
-rw-r--r--src/test/ui/parser/if-in-in.stderr2
-rw-r--r--src/test/ui/parser/issue-10392-2.fixed9
-rw-r--r--src/test/ui/parser/issue-10392-2.rs4
-rw-r--r--src/test/ui/parser/issue-10392-2.stderr2
-rw-r--r--src/test/ui/parser/issue-3036.fixed7
-rw-r--r--src/test/ui/parser/issue-3036.rs7
-rw-r--r--src/test/ui/parser/issue-3036.stderr6
-rw-r--r--src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.fixed14
-rw-r--r--src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs8
-rw-r--r--src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr18
-rw-r--r--src/test/ui/parser/issue-70388-without-witness.fixed9
-rw-r--r--src/test/ui/parser/issue-70388-without-witness.rs9
-rw-r--r--src/test/ui/parser/issue-70388-without-witness.stderr20
-rw-r--r--src/test/ui/parser/let-binop.fixed10
-rw-r--r--src/test/ui/parser/let-binop.rs2
-rw-r--r--src/test/ui/parser/let-binop.stderr6
-rw-r--r--src/test/ui/parser/match-refactor-to-expr.fixed12
-rw-r--r--src/test/ui/parser/match-refactor-to-expr.rs4
-rw-r--r--src/test/ui/parser/match-refactor-to-expr.stderr6
-rw-r--r--src/test/ui/parser/range_inclusive.fixed7
-rw-r--r--src/test/ui/parser/range_inclusive.rs1
-rw-r--r--src/test/ui/parser/range_inclusive.stderr2
-rw-r--r--src/test/ui/parser/trait-object-lifetime-parens.rs1
-rw-r--r--src/test/ui/parser/trait-object-lifetime-parens.stderr2
29 files changed, 345 insertions, 30 deletions
diff --git a/src/test/ui/parser/bad-fn-ptr-qualifier.fixed b/src/test/ui/parser/bad-fn-ptr-qualifier.fixed
new file mode 100644
index 00000000000..ad8e718cf88
--- /dev/null
+++ b/src/test/ui/parser/bad-fn-ptr-qualifier.fixed
@@ -0,0 +1,26 @@
+// run-rustfix
+// edition:2018
+// Most of items are taken from ./recover-const-async-fn-ptr.rs but this is able to apply rustfix.
+
+pub type T0 =  fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type T1 =  extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type T2 =  unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type T3 =  fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type T4 =  extern fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type T5 =  unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type T6 =   unsafe extern "C" fn();
+//~^ ERROR an `fn` pointer type cannot be `const`
+//~| ERROR an `fn` pointer type cannot be `async`
+
+pub type FTT0 = for<'a>  fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type FTT1 = for<'a>  extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type FTT2 = for<'a>  unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type FTT3 = for<'a>  fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type FTT4 = for<'a>  extern fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type FTT5 = for<'a>  unsafe extern "C" fn();
+//~^ ERROR an `fn` pointer type cannot be `async`
+pub type FTT6 = for<'a>   unsafe extern "C" fn();
+//~^ ERROR an `fn` pointer type cannot be `const`
+//~| ERROR an `fn` pointer type cannot be `async`
+
+fn main() {}
diff --git a/src/test/ui/parser/bad-fn-ptr-qualifier.rs b/src/test/ui/parser/bad-fn-ptr-qualifier.rs
new file mode 100644
index 00000000000..c04813dadff
--- /dev/null
+++ b/src/test/ui/parser/bad-fn-ptr-qualifier.rs
@@ -0,0 +1,26 @@
+// run-rustfix
+// edition:2018
+// Most of items are taken from ./recover-const-async-fn-ptr.rs but this is able to apply rustfix.
+
+pub type T0 = const fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type T1 = const extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type T2 = const unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type T3 = async fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type T4 = async extern fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type T5 = async unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type T6 = const async unsafe extern "C" fn();
+//~^ ERROR an `fn` pointer type cannot be `const`
+//~| ERROR an `fn` pointer type cannot be `async`
+
+pub type FTT0 = for<'a> const fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type FTT1 = for<'a> const extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type FTT2 = for<'a> const unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const`
+pub type FTT3 = for<'a> async fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type FTT4 = for<'a> async extern fn(); //~ ERROR an `fn` pointer type cannot be `async`
+pub type FTT5 = for<'a> async unsafe extern "C" fn();
+//~^ ERROR an `fn` pointer type cannot be `async`
+pub type FTT6 = for<'a> const async unsafe extern "C" fn();
+//~^ ERROR an `fn` pointer type cannot be `const`
+//~| ERROR an `fn` pointer type cannot be `async`
+
+fn main() {}
diff --git a/src/test/ui/parser/bad-fn-ptr-qualifier.stderr b/src/test/ui/parser/bad-fn-ptr-qualifier.stderr
new file mode 100644
index 00000000000..265e31329ca
--- /dev/null
+++ b/src/test/ui/parser/bad-fn-ptr-qualifier.stderr
@@ -0,0 +1,146 @@
+error: an `fn` pointer type cannot be `const`
+  --> $DIR/bad-fn-ptr-qualifier.rs:5:15
+   |
+LL | pub type T0 = const fn();
+   |               -----^^^^^
+   |               |
+   |               `const` because of this
+   |               help: remove the `const` qualifier
+
+error: an `fn` pointer type cannot be `const`
+  --> $DIR/bad-fn-ptr-qualifier.rs:6:15
+   |
+LL | pub type T1 = const extern "C" fn();
+   |               -----^^^^^^^^^^^^^^^^
+   |               |
+   |               `const` because of this
+   |               help: remove the `const` qualifier
+
+error: an `fn` pointer type cannot be `const`
+  --> $DIR/bad-fn-ptr-qualifier.rs:7:15
+   |
+LL | pub type T2 = const unsafe extern fn();
+   |               -----^^^^^^^^^^^^^^^^^^^
+   |               |
+   |               `const` because of this
+   |               help: remove the `const` qualifier
+
+error: an `fn` pointer type cannot be `async`
+  --> $DIR/bad-fn-ptr-qualifier.rs:8:15
+   |
+LL | pub type T3 = async fn();
+   |               -----^^^^^
+   |               |
+   |               `async` because of this
+   |               help: remove the `async` qualifier
+
+error: an `fn` pointer type cannot be `async`
+  --> $DIR/bad-fn-ptr-qualifier.rs:9:15
+   |
+LL | pub type T4 = async extern fn();
+   |               -----^^^^^^^^^^^^
+   |               |
+   |               `async` because of this
+   |               help: remove the `async` qualifier
+
+error: an `fn` pointer type cannot be `async`
+  --> $DIR/bad-fn-ptr-qualifier.rs:10:15
+   |
+LL | pub type T5 = async unsafe extern "C" fn();
+   |               -----^^^^^^^^^^^^^^^^^^^^^^^
+   |               |
+   |               `async` because of this
+   |               help: remove the `async` qualifier
+
+error: an `fn` pointer type cannot be `const`
+  --> $DIR/bad-fn-ptr-qualifier.rs:11:15
+   |
+LL | pub type T6 = const async unsafe extern "C" fn();
+   |               -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |               |
+   |               `const` because of this
+   |               help: remove the `const` qualifier
+
+error: an `fn` pointer type cannot be `async`
+  --> $DIR/bad-fn-ptr-qualifier.rs:11:15
+   |
+LL | pub type T6 = const async unsafe extern "C" fn();
+   |               ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^
+   |                     |
+   |                     `async` because of this
+   |                     help: remove the `async` qualifier
+
+error: an `fn` pointer type cannot be `const`
+  --> $DIR/bad-fn-ptr-qualifier.rs:15:17
+   |
+LL | pub type FTT0 = for<'a> const fn();
+   |                 ^^^^^^^^-----^^^^^
+   |                         |
+   |                         `const` because of this
+   |                         help: remove the `const` qualifier
+
+error: an `fn` pointer type cannot be `const`
+  --> $DIR/bad-fn-ptr-qualifier.rs:16:17
+   |
+LL | pub type FTT1 = for<'a> const extern "C" fn();
+   |                 ^^^^^^^^-----^^^^^^^^^^^^^^^^
+   |                         |
+   |                         `const` because of this
+   |                         help: remove the `const` qualifier
+
+error: an `fn` pointer type cannot be `const`
+  --> $DIR/bad-fn-ptr-qualifier.rs:17:17
+   |
+LL | pub type FTT2 = for<'a> const unsafe extern fn();
+   |                 ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^
+   |                         |
+   |                         `const` because of this
+   |                         help: remove the `const` qualifier
+
+error: an `fn` pointer type cannot be `async`
+  --> $DIR/bad-fn-ptr-qualifier.rs:18:17
+   |
+LL | pub type FTT3 = for<'a> async fn();
+   |                 ^^^^^^^^-----^^^^^
+   |                         |
+   |                         `async` because of this
+   |                         help: remove the `async` qualifier
+
+error: an `fn` pointer type cannot be `async`
+  --> $DIR/bad-fn-ptr-qualifier.rs:19:17
+   |
+LL | pub type FTT4 = for<'a> async extern fn();
+   |                 ^^^^^^^^-----^^^^^^^^^^^^
+   |                         |
+   |                         `async` because of this
+   |                         help: remove the `async` qualifier
+
+error: an `fn` pointer type cannot be `async`
+  --> $DIR/bad-fn-ptr-qualifier.rs:20:17
+   |
+LL | pub type FTT5 = for<'a> async unsafe extern "C" fn();
+   |                 ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^
+   |                         |
+   |                         `async` because of this
+   |                         help: remove the `async` qualifier
+
+error: an `fn` pointer type cannot be `const`
+  --> $DIR/bad-fn-ptr-qualifier.rs:22:17
+   |
+LL | pub type FTT6 = for<'a> const async unsafe extern "C" fn();
+   |                 ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                         |
+   |                         `const` because of this
+   |                         help: remove the `const` qualifier
+
+error: an `fn` pointer type cannot be `async`
+  --> $DIR/bad-fn-ptr-qualifier.rs:22:17
+   |
+LL | pub type FTT6 = for<'a> const async unsafe extern "C" fn();
+   |                 ^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^
+   |                               |
+   |                               `async` because of this
+   |                               help: remove the `async` qualifier
+
+error: aborting due to 16 previous errors
+
diff --git a/src/test/ui/parser/if-in-in.fixed b/src/test/ui/parser/if-in-in.fixed
new file mode 100644
index 00000000000..0bb88c55936
--- /dev/null
+++ b/src/test/ui/parser/if-in-in.fixed
@@ -0,0 +1,7 @@
+// run-rustfix
+
+fn main() {
+    for i in 1..2 { //~ ERROR expected iterable, found keyword `in`
+        println!("{}", i);
+    }
+}
diff --git a/src/test/ui/parser/if-in-in.rs b/src/test/ui/parser/if-in-in.rs
index 212378c2866..6c0986fe1ba 100644
--- a/src/test/ui/parser/if-in-in.rs
+++ b/src/test/ui/parser/if-in-in.rs
@@ -1,3 +1,5 @@
+// run-rustfix
+
 fn main() {
     for i in in 1..2 { //~ ERROR expected iterable, found keyword `in`
         println!("{}", i);
diff --git a/src/test/ui/parser/if-in-in.stderr b/src/test/ui/parser/if-in-in.stderr
index 1adb4429ec7..0e69bc4b2ce 100644
--- a/src/test/ui/parser/if-in-in.stderr
+++ b/src/test/ui/parser/if-in-in.stderr
@@ -1,5 +1,5 @@
 error: expected iterable, found keyword `in`
-  --> $DIR/if-in-in.rs:2:14
+  --> $DIR/if-in-in.rs:4:14
    |
 LL |     for i in in 1..2 {
    |           ---^^
diff --git a/src/test/ui/parser/issue-10392-2.fixed b/src/test/ui/parser/issue-10392-2.fixed
new file mode 100644
index 00000000000..3386fac17df
--- /dev/null
+++ b/src/test/ui/parser/issue-10392-2.fixed
@@ -0,0 +1,9 @@
+// run-rustfix
+
+pub struct A { pub foo: isize }
+
+fn a() -> A { panic!() }
+
+fn main() {
+    let A { .. } = a(); //~ ERROR: expected `}`
+}
diff --git a/src/test/ui/parser/issue-10392-2.rs b/src/test/ui/parser/issue-10392-2.rs
index 3b5e3199a8a..30628ae31c3 100644
--- a/src/test/ui/parser/issue-10392-2.rs
+++ b/src/test/ui/parser/issue-10392-2.rs
@@ -1,4 +1,6 @@
-struct A { foo: isize }
+// run-rustfix
+
+pub struct A { pub foo: isize }
 
 fn a() -> A { panic!() }
 
diff --git a/src/test/ui/parser/issue-10392-2.stderr b/src/test/ui/parser/issue-10392-2.stderr
index ccc5dd938b5..4154ecfeb71 100644
--- a/src/test/ui/parser/issue-10392-2.stderr
+++ b/src/test/ui/parser/issue-10392-2.stderr
@@ -1,5 +1,5 @@
 error: expected `}`, found `,`
-  --> $DIR/issue-10392-2.rs:6:15
+  --> $DIR/issue-10392-2.rs:8:15
    |
 LL |     let A { .., } = a();
    |             --^
diff --git a/src/test/ui/parser/issue-3036.fixed b/src/test/ui/parser/issue-3036.fixed
new file mode 100644
index 00000000000..e5d5622e6fc
--- /dev/null
+++ b/src/test/ui/parser/issue-3036.fixed
@@ -0,0 +1,7 @@
+// run-rustfix
+
+// Testing that semicolon tokens are printed correctly in errors
+
+fn main() {
+    let _x = 3; //~ ERROR: expected `;`
+}
diff --git a/src/test/ui/parser/issue-3036.rs b/src/test/ui/parser/issue-3036.rs
index 6a8b67fefa7..2f76fb99b22 100644
--- a/src/test/ui/parser/issue-3036.rs
+++ b/src/test/ui/parser/issue-3036.rs
@@ -1,6 +1,7 @@
+// run-rustfix
+
 // Testing that semicolon tokens are printed correctly in errors
 
-fn main()
-{
-    let x = 3 //~ ERROR: expected `;`
+fn main() {
+    let _x = 3 //~ ERROR: expected `;`
 }
diff --git a/src/test/ui/parser/issue-3036.stderr b/src/test/ui/parser/issue-3036.stderr
index e5f5a7d8968..e02223931c1 100644
--- a/src/test/ui/parser/issue-3036.stderr
+++ b/src/test/ui/parser/issue-3036.stderr
@@ -1,8 +1,8 @@
 error: expected `;`, found `}`
-  --> $DIR/issue-3036.rs:5:14
+  --> $DIR/issue-3036.rs:6:15
    |
-LL |     let x = 3
-   |              ^ help: add `;` here
+LL |     let _x = 3
+   |               ^ help: add `;` here
 LL | }
    | - unexpected token
 
diff --git a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.fixed b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.fixed
new file mode 100644
index 00000000000..95019b27869
--- /dev/null
+++ b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.fixed
@@ -0,0 +1,14 @@
+// run-rustfix
+
+// In this regression test for #67146, we check that the
+// negative outlives bound `!'a` is rejected by the parser.
+// This regression was first introduced in PR #57364.
+
+fn main() {}
+
+pub fn f1<T>() {}
+//~^ ERROR negative bounds are not supported
+pub fn f2<'a, T: Ord>() {}
+//~^ ERROR negative bounds are not supported
+pub fn f3<'a, T: Ord>() {}
+//~^ ERROR negative bounds are not supported
diff --git a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs
index 5a109ba7c68..82f54f8faa9 100644
--- a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs
+++ b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs
@@ -1,12 +1,14 @@
+// run-rustfix
+
 // In this regression test for #67146, we check that the
 // negative outlives bound `!'a` is rejected by the parser.
 // This regression was first introduced in PR #57364.
 
 fn main() {}
 
-fn f1<T: !'static>() {}
+pub fn f1<T: !'static>() {}
 //~^ ERROR negative bounds are not supported
-fn f2<'a, T: Ord + !'a>() {}
+pub fn f2<'a, T: Ord + !'a>() {}
 //~^ ERROR negative bounds are not supported
-fn f3<'a, T: !'a + Ord>() {}
+pub fn f3<'a, T: !'a + Ord>() {}
 //~^ ERROR negative bounds are not supported
diff --git a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr
index 4dc06347304..a4a422948ac 100644
--- a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr
+++ b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr
@@ -1,20 +1,20 @@
 error: negative bounds are not supported
-  --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:7:8
+  --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:9:12
    |
-LL | fn f1<T: !'static>() {}
-   |        ^^^^^^^^^^ negative bounds are not supported
+LL | pub fn f1<T: !'static>() {}
+   |            ^^^^^^^^^^ negative bounds are not supported
 
 error: negative bounds are not supported
-  --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:9:18
+  --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:11:22
    |
-LL | fn f2<'a, T: Ord + !'a>() {}
-   |                  ^^^^^ negative bounds are not supported
+LL | pub fn f2<'a, T: Ord + !'a>() {}
+   |                      ^^^^^ negative bounds are not supported
 
 error: negative bounds are not supported
-  --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:11:12
+  --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:13:16
    |
-LL | fn f3<'a, T: !'a + Ord>() {}
-   |            ^^^^^ negative bounds are not supported
+LL | pub fn f3<'a, T: !'a + Ord>() {}
+   |                ^^^^^ negative bounds are not supported
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/parser/issue-70388-without-witness.fixed b/src/test/ui/parser/issue-70388-without-witness.fixed
new file mode 100644
index 00000000000..464e78fd035
--- /dev/null
+++ b/src/test/ui/parser/issue-70388-without-witness.fixed
@@ -0,0 +1,9 @@
+// run-rustfix
+// This is for checking if we can apply suggestions as-is.
+
+pub struct Foo(i32);
+
+fn main() {
+    let Foo(..) = Foo(0); //~ ERROR unexpected `...`
+    let [_, .., _] = [0, 1]; //~ ERROR unexpected `...`
+}
diff --git a/src/test/ui/parser/issue-70388-without-witness.rs b/src/test/ui/parser/issue-70388-without-witness.rs
new file mode 100644
index 00000000000..9e35e4c38aa
--- /dev/null
+++ b/src/test/ui/parser/issue-70388-without-witness.rs
@@ -0,0 +1,9 @@
+// run-rustfix
+// This is for checking if we can apply suggestions as-is.
+
+pub struct Foo(i32);
+
+fn main() {
+    let Foo(...) = Foo(0); //~ ERROR unexpected `...`
+    let [_, ..., _] = [0, 1]; //~ ERROR unexpected `...`
+}
diff --git a/src/test/ui/parser/issue-70388-without-witness.stderr b/src/test/ui/parser/issue-70388-without-witness.stderr
new file mode 100644
index 00000000000..b750ad4c626
--- /dev/null
+++ b/src/test/ui/parser/issue-70388-without-witness.stderr
@@ -0,0 +1,20 @@
+error: unexpected `...`
+  --> $DIR/issue-70388-without-witness.rs:7:13
+   |
+LL |     let Foo(...) = Foo(0);
+   |             ^^^
+   |             |
+   |             not a valid pattern
+   |             help: for a rest pattern, use `..` instead of `...`
+
+error: unexpected `...`
+  --> $DIR/issue-70388-without-witness.rs:8:13
+   |
+LL |     let [_, ..., _] = [0, 1];
+   |             ^^^
+   |             |
+   |             not a valid pattern
+   |             help: for a rest pattern, use `..` instead of `...`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/parser/let-binop.fixed b/src/test/ui/parser/let-binop.fixed
new file mode 100644
index 00000000000..93f7f97b04f
--- /dev/null
+++ b/src/test/ui/parser/let-binop.fixed
@@ -0,0 +1,10 @@
+// run-rustfix
+
+fn main() {
+    let a: i8 = 1; //~ ERROR can't reassign to an uninitialized variable
+    let _ = a;
+    let b = 1; //~ ERROR can't reassign to an uninitialized variable
+    let _ = b;
+    let c = 1; //~ ERROR can't reassign to an uninitialized variable
+    let _ = c;
+}
diff --git a/src/test/ui/parser/let-binop.rs b/src/test/ui/parser/let-binop.rs
index 7f58f5df2d4..2adbceae5d3 100644
--- a/src/test/ui/parser/let-binop.rs
+++ b/src/test/ui/parser/let-binop.rs
@@ -1,3 +1,5 @@
+// run-rustfix
+
 fn main() {
     let a: i8 *= 1; //~ ERROR can't reassign to an uninitialized variable
     let _ = a;
diff --git a/src/test/ui/parser/let-binop.stderr b/src/test/ui/parser/let-binop.stderr
index 71431499ac7..90295854a2d 100644
--- a/src/test/ui/parser/let-binop.stderr
+++ b/src/test/ui/parser/let-binop.stderr
@@ -1,17 +1,17 @@
 error: can't reassign to an uninitialized variable
-  --> $DIR/let-binop.rs:2:15
+  --> $DIR/let-binop.rs:4:15
    |
 LL |     let a: i8 *= 1;
    |               ^^ help: initialize the variable
 
 error: can't reassign to an uninitialized variable
-  --> $DIR/let-binop.rs:4:11
+  --> $DIR/let-binop.rs:6:11
    |
 LL |     let b += 1;
    |           ^^ help: initialize the variable
 
 error: can't reassign to an uninitialized variable
-  --> $DIR/let-binop.rs:6:11
+  --> $DIR/let-binop.rs:8:11
    |
 LL |     let c *= 1;
    |           ^^ help: initialize the variable
diff --git a/src/test/ui/parser/match-refactor-to-expr.fixed b/src/test/ui/parser/match-refactor-to-expr.fixed
new file mode 100644
index 00000000000..f21024235a5
--- /dev/null
+++ b/src/test/ui/parser/match-refactor-to-expr.fixed
@@ -0,0 +1,12 @@
+// run-rustfix
+
+fn main() {
+    let foo =
+         //~ NOTE while parsing this match expression
+        Some(4).unwrap_or(5)
+        //~^ NOTE expected one of `.`, `?`, `{`, or an operator
+        ; //~ NOTE unexpected token
+        //~^ ERROR expected one of `.`, `?`, `{`, or an operator, found `;`
+
+    println!("{}", foo)
+}
diff --git a/src/test/ui/parser/match-refactor-to-expr.rs b/src/test/ui/parser/match-refactor-to-expr.rs
index e10ebf2e2d6..e02d74e2f7e 100644
--- a/src/test/ui/parser/match-refactor-to-expr.rs
+++ b/src/test/ui/parser/match-refactor-to-expr.rs
@@ -1,7 +1,9 @@
+// run-rustfix
+
 fn main() {
     let foo =
         match //~ NOTE while parsing this match expression
-        Some(4).unwrap_or_else(5)
+        Some(4).unwrap_or(5)
         //~^ NOTE expected one of `.`, `?`, `{`, or an operator
         ; //~ NOTE unexpected token
         //~^ ERROR expected one of `.`, `?`, `{`, or an operator, found `;`
diff --git a/src/test/ui/parser/match-refactor-to-expr.stderr b/src/test/ui/parser/match-refactor-to-expr.stderr
index 5cbf0232bc3..15107ab9a25 100644
--- a/src/test/ui/parser/match-refactor-to-expr.stderr
+++ b/src/test/ui/parser/match-refactor-to-expr.stderr
@@ -1,13 +1,13 @@
 error: expected one of `.`, `?`, `{`, or an operator, found `;`
-  --> $DIR/match-refactor-to-expr.rs:6:9
+  --> $DIR/match-refactor-to-expr.rs:8:9
    |
 LL |         match
    |         -----
    |         |
    |         while parsing this match expression
    |         help: try removing this `match`
-LL |         Some(4).unwrap_or_else(5)
-   |                                  - expected one of `.`, `?`, `{`, or an operator
+LL |         Some(4).unwrap_or(5)
+   |                             - expected one of `.`, `?`, `{`, or an operator
 LL |
 LL |         ;
    |         ^ unexpected token
diff --git a/src/test/ui/parser/range_inclusive.fixed b/src/test/ui/parser/range_inclusive.fixed
new file mode 100644
index 00000000000..fe23880d1d4
--- /dev/null
+++ b/src/test/ui/parser/range_inclusive.fixed
@@ -0,0 +1,7 @@
+// run-rustfix
+// Make sure that inclusive ranges with no end point don't parse.
+
+pub fn main() {
+    for _ in 1.. {} //~ERROR inclusive range with no end
+                     //~^HELP use `..` instead
+}
diff --git a/src/test/ui/parser/range_inclusive.rs b/src/test/ui/parser/range_inclusive.rs
index 7c3b906b47f..bc6d2413d26 100644
--- a/src/test/ui/parser/range_inclusive.rs
+++ b/src/test/ui/parser/range_inclusive.rs
@@ -1,3 +1,4 @@
+// run-rustfix
 // Make sure that inclusive ranges with no end point don't parse.
 
 pub fn main() {
diff --git a/src/test/ui/parser/range_inclusive.stderr b/src/test/ui/parser/range_inclusive.stderr
index 1dd47994596..8a91782639f 100644
--- a/src/test/ui/parser/range_inclusive.stderr
+++ b/src/test/ui/parser/range_inclusive.stderr
@@ -1,5 +1,5 @@
 error[E0586]: inclusive range with no end
-  --> $DIR/range_inclusive.rs:4:15
+  --> $DIR/range_inclusive.rs:5:15
    |
 LL |     for _ in 1..= {}
    |               ^^^ help: use `..` instead
diff --git a/src/test/ui/parser/trait-object-lifetime-parens.rs b/src/test/ui/parser/trait-object-lifetime-parens.rs
index 5a5c19f32e8..f44ebe5ba5b 100644
--- a/src/test/ui/parser/trait-object-lifetime-parens.rs
+++ b/src/test/ui/parser/trait-object-lifetime-parens.rs
@@ -6,6 +6,7 @@ fn f<'a, T: Trait + ('a)>() {} //~ ERROR parenthesized lifetime bounds are not s
 
 fn check<'a>() {
     let _: Box<Trait + ('a)>; //~ ERROR parenthesized lifetime bounds are not supported
+    // FIXME: It'd be great if we could add suggestion to the following case.
     let _: Box<('a) + Trait>; //~ ERROR lifetime in trait object type must be followed by `+`
 }
 
diff --git a/src/test/ui/parser/trait-object-lifetime-parens.stderr b/src/test/ui/parser/trait-object-lifetime-parens.stderr
index 1289c248275..9c7a9662c40 100644
--- a/src/test/ui/parser/trait-object-lifetime-parens.stderr
+++ b/src/test/ui/parser/trait-object-lifetime-parens.stderr
@@ -11,7 +11,7 @@ LL |     let _: Box<Trait + ('a)>;
    |                        ^^^^ help: remove the parentheses
 
 error: lifetime in trait object type must be followed by `+`
-  --> $DIR/trait-object-lifetime-parens.rs:9:17
+  --> $DIR/trait-object-lifetime-parens.rs:10:17
    |
 LL |     let _: Box<('a) + Trait>;
    |                 ^^