diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-06 17:45:22 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-06 17:45:22 -0700 |
| commit | e74ab50d07a8b21e8d03ebfb0da8dae6583b1e67 (patch) | |
| tree | 168e729a30abda7528a52c811ea689fc14ed8f5e /src/test/ui/error-codes | |
| parent | 7942d9a65a1100c840c7d55172c7e9588066719d (diff) | |
| parent | 84282fd6f17235ca52613bbfd1cb6be301897836 (diff) | |
Rollup merge of #73953 - JohnTitor:audit-hidden-sugg, r=estebank
Audit hidden/short code suggestions Should fix #73641. Audit uses of `span_suggestion_short` and `tool_only_span_suggestion` (`span_suggestion_hidden` is already tested with `run-rustfix`). Leave some FIXMEs for futher improvements/fixes. r? @estebank
Diffstat (limited to 'src/test/ui/error-codes')
| -rw-r--r-- | src/test/ui/error-codes/E0642.fixed | 20 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0642.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0642.stderr | 6 |
3 files changed, 27 insertions, 3 deletions
diff --git a/src/test/ui/error-codes/E0642.fixed b/src/test/ui/error-codes/E0642.fixed new file mode 100644 index 00000000000..fc6255e0274 --- /dev/null +++ b/src/test/ui/error-codes/E0642.fixed @@ -0,0 +1,20 @@ +// run-rustfix + +#![allow(unused)] // for rustfix + +#[derive(Clone, Copy)] +struct S; + +trait T { + fn foo(_: (i32, i32)); //~ ERROR patterns aren't allowed in methods without bodies + + fn bar(_: (i32, i32)) {} //~ ERROR patterns aren't allowed in methods without bodies + + fn method(_: S) {} //~ ERROR patterns aren't allowed in methods without bodies + + fn f(&ident: &S) {} // ok + fn g(&&ident: &&S) {} // ok + fn h(mut ident: S) {} // ok +} + +fn main() {} diff --git a/src/test/ui/error-codes/E0642.rs b/src/test/ui/error-codes/E0642.rs index cfbd362c1da..5f85f3935e1 100644 --- a/src/test/ui/error-codes/E0642.rs +++ b/src/test/ui/error-codes/E0642.rs @@ -1,3 +1,7 @@ +// run-rustfix + +#![allow(unused)] // for rustfix + #[derive(Clone, Copy)] struct S; diff --git a/src/test/ui/error-codes/E0642.stderr b/src/test/ui/error-codes/E0642.stderr index 45486a5d632..83fcac042b1 100644 --- a/src/test/ui/error-codes/E0642.stderr +++ b/src/test/ui/error-codes/E0642.stderr @@ -1,5 +1,5 @@ error[E0642]: patterns aren't allowed in methods without bodies - --> $DIR/E0642.rs:5:12 + --> $DIR/E0642.rs:9:12 | LL | fn foo((x, y): (i32, i32)); | ^^^^^^ @@ -10,7 +10,7 @@ LL | fn foo(_: (i32, i32)); | ^ error[E0642]: patterns aren't allowed in methods without bodies - --> $DIR/E0642.rs:7:12 + --> $DIR/E0642.rs:11:12 | LL | fn bar((x, y): (i32, i32)) {} | ^^^^^^ @@ -21,7 +21,7 @@ LL | fn bar(_: (i32, i32)) {} | ^ error[E0642]: patterns aren't allowed in methods without bodies - --> $DIR/E0642.rs:9:15 + --> $DIR/E0642.rs:13:15 | LL | fn method(S { .. }: S) {} | ^^^^^^^^ |
