Skip to content

Commit ba8fd0e

Browse files
committed
Update stderr
1 parent 4f2b25c commit ba8fd0e

File tree

2 files changed

+86
-42
lines changed

2 files changed

+86
-42
lines changed

tests/ui/cfg/path-kw-as-cfg-pred.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ macro_rules! foo {
1111
#[cfg_attr(true, cfg($crate))] //~ ERROR malformed `cfg` attribute input
1212
mod _cfg_attr_true_cfg_crate {}
1313

14-
cfg!($crate); //~ ERROR `cfg` predicate key must be an identifier
14+
cfg!($crate); //~ ERROR malformed `cfg` macro input
1515
};
1616
}
1717

@@ -62,19 +62,19 @@ mod _cfg_attr_true_cfg_underscore {}
6262
fn main() {
6363
foo!();
6464

65-
cfg!(crate); //~ ERROR `cfg` predicate key must be an identifier
66-
cfg!(super); //~ ERROR `cfg` predicate key must be an identifier
67-
cfg!(self); //~ ERROR `cfg` predicate key must be an identifier
68-
cfg!(Self); //~ ERROR `cfg` predicate key must be an identifier
65+
cfg!(crate); //~ ERROR malformed `cfg` macro input
66+
cfg!(super); //~ ERROR malformed `cfg` macro input
67+
cfg!(self); //~ ERROR malformed `cfg` macro input
68+
cfg!(Self); //~ ERROR malformed `cfg` macro input
6969

7070
cfg!(r#crate); //~ ERROR `crate` cannot be a raw identifier
71-
//~^ ERROR `cfg` predicate key must be an identifier
71+
//~^ ERROR malformed `cfg` macro input
7272
cfg!(r#super); //~ ERROR `super` cannot be a raw identifier
73-
//~^ ERROR `cfg` predicate key must be an identifier
73+
//~^ ERROR malformed `cfg` macro input
7474
cfg!(r#self); //~ ERROR `self` cannot be a raw identifier
75-
//~^ ERROR `cfg` predicate key must be an identifier
75+
//~^ ERROR malformed `cfg` macro input
7676
cfg!(r#Self); //~ ERROR `Self` cannot be a raw identifier
77-
//~^ ERROR `cfg` predicate key must be an identifier
77+
//~^ ERROR malformed `cfg` macro input
7878

7979
cfg!(struct); //~ ERROR expected identifier, found keyword
8080
cfg!(priv); //~ ERROR expected identifier, found reserved keyword `priv`

tests/ui/cfg/path-kw-as-cfg-pred.stderr

Lines changed: 77 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ LL | #[cfg_attr(true, cfg(crate))]
213213
| ^^^^-----^
214214
| | |
215215
| | expected a valid identifier here
216-
| help: must be of the form: `#[cfg(predicate)]`
216+
| help: must be of the form: `cfg(predicate)`
217217
|
218218
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
219219

@@ -224,7 +224,7 @@ LL | #[cfg_attr(true, cfg(super))]
224224
| ^^^^-----^
225225
| | |
226226
| | expected a valid identifier here
227-
| help: must be of the form: `#[cfg(predicate)]`
227+
| help: must be of the form: `cfg(predicate)`
228228
|
229229
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
230230

@@ -235,7 +235,7 @@ LL | #[cfg_attr(true, cfg(self))]
235235
| ^^^^----^
236236
| | |
237237
| | expected a valid identifier here
238-
| help: must be of the form: `#[cfg(predicate)]`
238+
| help: must be of the form: `cfg(predicate)`
239239
|
240240
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
241241

@@ -246,7 +246,7 @@ LL | #[cfg_attr(true, cfg(Self))]
246246
| ^^^^----^
247247
| | |
248248
| | expected a valid identifier here
249-
| help: must be of the form: `#[cfg(predicate)]`
249+
| help: must be of the form: `cfg(predicate)`
250250
|
251251
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
252252

@@ -439,72 +439,116 @@ LL | #[cfg_attr(true, cfg($crate))]
439439
| ^^^^------^
440440
| | |
441441
| | expected a valid identifier here
442-
| help: must be of the form: `#[cfg(predicate)]`
442+
| help: must be of the form: `cfg(predicate)`
443443
...
444444
LL | foo!();
445445
| ------ in this macro invocation
446446
|
447447
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
448448
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
449449

450-
error: `cfg` predicate key must be an identifier
451-
--> $DIR/path-kw-as-cfg-pred.rs:14:14
450+
error[E0539]: malformed `cfg` macro input
451+
--> $DIR/path-kw-as-cfg-pred.rs:14:9
452452
|
453453
LL | cfg!($crate);
454-
| ^^^^^^
454+
| ^^^^^------^
455+
| | |
456+
| | expected a valid identifier here
457+
| help: must be of the form: `cfg(predicate)`
455458
...
456459
LL | foo!();
457460
| ------ in this macro invocation
458461
|
459-
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
462+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
463+
= note: this error originates in the macro `cfg` which comes from the expansion of the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
460464

461-
error: `cfg` predicate key must be an identifier
462-
--> $DIR/path-kw-as-cfg-pred.rs:65:10
465+
error[E0539]: malformed `cfg` macro input
466+
--> $DIR/path-kw-as-cfg-pred.rs:65:5
463467
|
464468
LL | cfg!(crate);
465-
| ^^^^^
469+
| ^^^^^-----^
470+
| | |
471+
| | expected a valid identifier here
472+
| help: must be of the form: `cfg(predicate)`
473+
|
474+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
466475

467-
error: `cfg` predicate key must be an identifier
468-
--> $DIR/path-kw-as-cfg-pred.rs:66:10
476+
error[E0539]: malformed `cfg` macro input
477+
--> $DIR/path-kw-as-cfg-pred.rs:66:5
469478
|
470479
LL | cfg!(super);
471-
| ^^^^^
480+
| ^^^^^-----^
481+
| | |
482+
| | expected a valid identifier here
483+
| help: must be of the form: `cfg(predicate)`
484+
|
485+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
472486

473-
error: `cfg` predicate key must be an identifier
474-
--> $DIR/path-kw-as-cfg-pred.rs:67:10
487+
error[E0539]: malformed `cfg` macro input
488+
--> $DIR/path-kw-as-cfg-pred.rs:67:5
475489
|
476490
LL | cfg!(self);
477-
| ^^^^
491+
| ^^^^^----^
492+
| | |
493+
| | expected a valid identifier here
494+
| help: must be of the form: `cfg(predicate)`
495+
|
496+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
478497

479-
error: `cfg` predicate key must be an identifier
480-
--> $DIR/path-kw-as-cfg-pred.rs:68:10
498+
error[E0539]: malformed `cfg` macro input
499+
--> $DIR/path-kw-as-cfg-pred.rs:68:5
481500
|
482501
LL | cfg!(Self);
483-
| ^^^^
502+
| ^^^^^----^
503+
| | |
504+
| | expected a valid identifier here
505+
| help: must be of the form: `cfg(predicate)`
506+
|
507+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
484508

485-
error: `cfg` predicate key must be an identifier
486-
--> $DIR/path-kw-as-cfg-pred.rs:70:10
509+
error[E0539]: malformed `cfg` macro input
510+
--> $DIR/path-kw-as-cfg-pred.rs:70:5
487511
|
488512
LL | cfg!(r#crate);
489-
| ^^^^^^^
513+
| ^^^^^-------^
514+
| | |
515+
| | expected a valid identifier here
516+
| help: must be of the form: `cfg(predicate)`
517+
|
518+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
490519

491-
error: `cfg` predicate key must be an identifier
492-
--> $DIR/path-kw-as-cfg-pred.rs:72:10
520+
error[E0539]: malformed `cfg` macro input
521+
--> $DIR/path-kw-as-cfg-pred.rs:72:5
493522
|
494523
LL | cfg!(r#super);
495-
| ^^^^^^^
524+
| ^^^^^-------^
525+
| | |
526+
| | expected a valid identifier here
527+
| help: must be of the form: `cfg(predicate)`
528+
|
529+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
496530

497-
error: `cfg` predicate key must be an identifier
498-
--> $DIR/path-kw-as-cfg-pred.rs:74:10
531+
error[E0539]: malformed `cfg` macro input
532+
--> $DIR/path-kw-as-cfg-pred.rs:74:5
499533
|
500534
LL | cfg!(r#self);
501-
| ^^^^^^
535+
| ^^^^^------^
536+
| | |
537+
| | expected a valid identifier here
538+
| help: must be of the form: `cfg(predicate)`
539+
|
540+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
502541

503-
error: `cfg` predicate key must be an identifier
504-
--> $DIR/path-kw-as-cfg-pred.rs:76:10
542+
error[E0539]: malformed `cfg` macro input
543+
--> $DIR/path-kw-as-cfg-pred.rs:76:5
505544
|
506545
LL | cfg!(r#Self);
507-
| ^^^^^^
546+
| ^^^^^------^
547+
| | |
548+
| | expected a valid identifier here
549+
| help: must be of the form: `cfg(predicate)`
550+
|
551+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
508552

509553
error: expected identifier, found keyword `struct`
510554
--> $DIR/path-kw-as-cfg-pred.rs:79:10

0 commit comments

Comments
 (0)