Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5e98118

Browse files
committed
Fully redact the [E0788] error message in tests, to make changes easier
1 parent d4005b6 commit 5e98118

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

tests/ui/coverage-attr/allowed-positions.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,55 @@
88
#![warn(unused_attributes)]
99
#![coverage(off)]
1010

11-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
11+
#[coverage(off)] //~ ERROR [E0788]
1212
trait Trait {
13-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
13+
#[coverage(off)] //~ ERROR [E0788]
1414
const X: u32;
1515

16-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
16+
#[coverage(off)] //~ ERROR [E0788]
1717
type T;
1818

1919
type U;
2020

21-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
21+
#[coverage(off)] //~ ERROR [E0788]
2222
fn f(&self);
2323

24-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
24+
#[coverage(off)] //~ ERROR [E0788]
2525
fn g();
2626
}
2727

2828
#[coverage(off)]
2929
impl Trait for () {
3030
const X: u32 = 0;
3131

32-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
32+
#[coverage(off)] //~ ERROR [E0788]
3333
type T = Self;
3434

35-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
35+
#[coverage(off)] //~ ERROR [E0788]
3636
type U = impl Trait; //~ ERROR unconstrained opaque type
3737

3838
fn f(&self) {}
3939
fn g() {}
4040
}
4141

4242
extern "C" {
43-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
43+
#[coverage(off)] //~ ERROR [E0788]
4444
static X: u32;
4545

46-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
46+
#[coverage(off)] //~ ERROR [E0788]
4747
type T;
4848
}
4949

5050
#[coverage(off)]
5151
fn main() {
52-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
52+
#[coverage(off)] //~ ERROR [E0788]
5353
let _ = ();
5454

5555
match () {
56-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
56+
#[coverage(off)] //~ ERROR [E0788]
5757
() => (),
5858
}
5959

60-
#[coverage(off)] //~ ERROR attribute should be applied to a function definition or closure
60+
#[coverage(off)] //~ ERROR [E0788]
6161
return ();
6262
}

tests/ui/coverage-attr/name-value.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@ mod my_mod_inner {
2020

2121
#[coverage = "off"]
2222
//~^ ERROR malformed `coverage` attribute input
23-
//~| ERROR attribute should be applied to a function definition or closure
23+
//~| ERROR [E0788]
2424
struct MyStruct;
2525

2626
#[coverage = "off"]
2727
//~^ ERROR malformed `coverage` attribute input
2828
impl MyStruct {
2929
#[coverage = "off"]
3030
//~^ ERROR malformed `coverage` attribute input
31-
//~| ERROR attribute should be applied to a function definition or closure
31+
//~| ERROR [E0788]
3232
const X: u32 = 7;
3333
}
3434

3535
#[coverage = "off"]
3636
//~^ ERROR malformed `coverage` attribute input
37-
//~| ERROR attribute should be applied to a function definition or closure
37+
//~| ERROR [E0788]
3838
trait MyTrait {
3939
#[coverage = "off"]
4040
//~^ ERROR malformed `coverage` attribute input
41-
//~| ERROR attribute should be applied to a function definition or closure
41+
//~| ERROR [E0788]
4242
const X: u32;
4343

4444
#[coverage = "off"]
4545
//~^ ERROR malformed `coverage` attribute input
46-
//~| ERROR attribute should be applied to a function definition or closure
46+
//~| ERROR [E0788]
4747
type T;
4848
}
4949

@@ -52,12 +52,12 @@ trait MyTrait {
5252
impl MyTrait for MyStruct {
5353
#[coverage = "off"]
5454
//~^ ERROR malformed `coverage` attribute input
55-
//~| ERROR attribute should be applied to a function definition or closure
55+
//~| ERROR [E0788]
5656
const X: u32 = 8;
5757

5858
#[coverage = "off"]
5959
//~^ ERROR malformed `coverage` attribute input
60-
//~| ERROR attribute should be applied to a function definition or closure
60+
//~| ERROR [E0788]
6161
type T = ();
6262
}
6363

tests/ui/coverage-attr/word-only.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@ mod my_mod_inner {
2020

2121
#[coverage]
2222
//~^ ERROR malformed `coverage` attribute input
23-
//~| ERROR attribute should be applied to a function definition or closure
23+
//~| ERROR [E0788]
2424
struct MyStruct;
2525

2626
#[coverage]
2727
//~^ ERROR malformed `coverage` attribute input
2828
impl MyStruct {
2929
#[coverage]
3030
//~^ ERROR malformed `coverage` attribute input
31-
//~| ERROR attribute should be applied to a function definition or closure
31+
//~| ERROR [E0788]
3232
const X: u32 = 7;
3333
}
3434

3535
#[coverage]
3636
//~^ ERROR malformed `coverage` attribute input
37-
//~| ERROR attribute should be applied to a function definition or closure
37+
//~| ERROR [E0788]
3838
trait MyTrait {
3939
#[coverage]
4040
//~^ ERROR malformed `coverage` attribute input
41-
//~| ERROR attribute should be applied to a function definition or closure
41+
//~| ERROR [E0788]
4242
const X: u32;
4343

4444
#[coverage]
4545
//~^ ERROR malformed `coverage` attribute input
46-
//~| ERROR attribute should be applied to a function definition or closure
46+
//~| ERROR [E0788]
4747
type T;
4848
}
4949

@@ -52,12 +52,12 @@ trait MyTrait {
5252
impl MyTrait for MyStruct {
5353
#[coverage]
5454
//~^ ERROR malformed `coverage` attribute input
55-
//~| ERROR attribute should be applied to a function definition or closure
55+
//~| ERROR [E0788]
5656
const X: u32 = 8;
5757

5858
#[coverage]
5959
//~^ ERROR malformed `coverage` attribute input
60-
//~| ERROR attribute should be applied to a function definition or closure
60+
//~| ERROR [E0788]
6161
type T = ();
6262
}
6363

0 commit comments

Comments
 (0)