diff --git a/src/librustc_builtin_macros/format.rs b/src/librustc_builtin_macros/format.rs index e574b076bf8..e3ac4efe1a0 100644 --- a/src/librustc_builtin_macros/format.rs +++ b/src/librustc_builtin_macros/format.rs @@ -277,6 +277,8 @@ impl<'a, 'b> Context<'a, 'b> { ("x", "LowerHex"), ("X", "UpperHex"), ] { + // FIXME: rustfix (`run-rustfix`) fails to apply suggestions. + // > "Cannot replace slice of data that was already replaced" err.tool_only_span_suggestion( sp, &format!("use the `{}` trait", name), 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() {} +//~^ 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() {} +pub fn f1() {} //~^ 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() {} - | ^^^^^^^^^^ negative bounds are not supported +LL | pub fn f1() {} + | ^^^^^^^^^^ 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/resolve/resolve-conflict-import-vs-import.fixed b/src/test/ui/resolve/resolve-conflict-import-vs-import.fixed new file mode 100644 index 00000000000..e429513b51d --- /dev/null +++ b/src/test/ui/resolve/resolve-conflict-import-vs-import.fixed @@ -0,0 +1,9 @@ +// run-rustfix + +#[allow(unused_imports)] +use std::mem::transmute; + +//~^ ERROR the name `transmute` is defined multiple times + +fn main() { +} diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-import.rs b/src/test/ui/resolve/resolve-conflict-import-vs-import.rs index 322f000040e..43853117af6 100644 --- a/src/test/ui/resolve/resolve-conflict-import-vs-import.rs +++ b/src/test/ui/resolve/resolve-conflict-import-vs-import.rs @@ -1,3 +1,6 @@ +// run-rustfix + +#[allow(unused_imports)] use std::mem::transmute; use std::mem::transmute; //~^ ERROR the name `transmute` is defined multiple times diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr index 8df68ad3229..632be50f4c4 100644 --- a/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr +++ b/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr @@ -1,5 +1,5 @@ error[E0252]: the name `transmute` is defined multiple times - --> $DIR/resolve-conflict-import-vs-import.rs:2:5 + --> $DIR/resolve-conflict-import-vs-import.rs:5:5 | LL | use std::mem::transmute; | ------------------- previous import of the value `transmute` here