parser: tweak item kind wording

This commit is contained in:
Mazdak Farrokhzad 2020-02-23 06:04:37 +01:00
parent ab84914fe4
commit b01c1e2092
12 changed files with 115 additions and 112 deletions

View file

@ -31,110 +31,110 @@ mod free_items {
#[cfg(FALSE)]
extern "C" {
default extern crate foo; //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR extern crate not supported in `extern` block
default use foo; //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR `use` import not supported in `extern` block
default static foo: u8; //~ ERROR item cannot be `default`
default const foo: u8; //~ ERROR item cannot be `default`
//~^ ERROR extern items cannot be `const`
default fn foo(); //~ ERROR item cannot be `default`
default mod foo {} //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR module not supported in `extern` block
default extern "C" {} //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR extern block not supported in `extern` block
default type foo = u8; //~ ERROR item cannot be `default`
default enum foo {} //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR enum not supported in `extern` block
default struct foo {} //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR struct not supported in `extern` block
default union foo {} //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR union not supported in `extern` block
default trait foo {} //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR trait not supported in `extern` block
default trait foo = Ord; //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR trait alias not supported in `extern` block
default impl foo {}
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR implementation not supported in `extern` block
default!();
default::foo::bar!();
default default!(); //~ ERROR item cannot be `default`
default default::foo::bar!(); //~ ERROR item cannot be `default`
default macro foo {} //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR macro definition not supported in `extern` block
default macro_rules! foo {} //~ ERROR item cannot be `default`
//~^ ERROR item kind not supported in `extern` block
//~^ ERROR macro definition not supported in `extern` block
}
#[cfg(FALSE)]
impl S {
default extern crate foo;
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR extern crate not supported in `trait` or `impl`
default use foo;
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR `use` import not supported in `trait` or `impl`
default static foo: u8;
//~^ ERROR associated `static` items are not allowed
default const foo: u8;
default fn foo();
default mod foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR module not supported in `trait` or `impl`
default extern "C" {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR extern block not supported in `trait` or `impl`
default type foo = u8;
default enum foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR enum not supported in `trait` or `impl`
default struct foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR struct not supported in `trait` or `impl`
default union foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR union not supported in `trait` or `impl`
default trait foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR trait not supported in `trait` or `impl`
default trait foo = Ord;
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR trait alias not supported in `trait` or `impl`
default impl foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR implementation not supported in `trait` or `impl`
default!();
default::foo::bar!();
default default!();
default default::foo::bar!();
default macro foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR macro definition not supported in `trait` or `impl`
default macro_rules! foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR macro definition not supported in `trait` or `impl`
}
#[cfg(FALSE)]
trait T {
default extern crate foo;
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR extern crate not supported in `trait` or `impl`
default use foo;
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR `use` import not supported in `trait` or `impl`
default static foo: u8;
//~^ ERROR associated `static` items are not allowed
default const foo: u8;
default fn foo();
default mod foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR module not supported in `trait` or `impl`
default extern "C" {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR extern block not supported in `trait` or `impl`
default type foo = u8;
default enum foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR enum not supported in `trait` or `impl`
default struct foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR struct not supported in `trait` or `impl`
default union foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR union not supported in `trait` or `impl`
default trait foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR trait not supported in `trait` or `impl`
default trait foo = Ord;
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR trait alias not supported in `trait` or `impl`
default impl foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR implementation not supported in `trait` or `impl`
default!();
default::foo::bar!();
default default!();
default default::foo::bar!();
default macro foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR macro definition not supported in `trait` or `impl`
default macro_rules! foo {}
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR macro definition not supported in `trait` or `impl`
}

View file

@ -142,7 +142,7 @@ LL | default extern crate foo;
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: extern crate not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:33:5
|
LL | default extern crate foo;
@ -156,7 +156,7 @@ LL | default use foo;
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: `use` import not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:35:5
|
LL | default use foo;
@ -204,7 +204,7 @@ LL | default mod foo {}
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: module not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:41:5
|
LL | default mod foo {}
@ -218,7 +218,7 @@ LL | default extern "C" {}
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: extern block not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:43:5
|
LL | default extern "C" {}
@ -240,7 +240,7 @@ LL | default enum foo {}
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: enum not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:46:5
|
LL | default enum foo {}
@ -254,7 +254,7 @@ LL | default struct foo {}
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: struct not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:48:5
|
LL | default struct foo {}
@ -268,7 +268,7 @@ LL | default union foo {}
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: union not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:50:5
|
LL | default union foo {}
@ -282,7 +282,7 @@ LL | default trait foo {}
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: trait not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:52:5
|
LL | default trait foo {}
@ -296,13 +296,13 @@ LL | default trait foo = Ord;
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: trait alias not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:54:5
|
LL | default trait foo = Ord;
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `extern` block
error: implementation not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:56:5
|
LL | default impl foo {}
@ -332,7 +332,7 @@ LL | default macro foo {}
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: macro definition not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:62:5
|
LL | default macro foo {}
@ -346,19 +346,19 @@ LL | default macro_rules! foo {}
|
= note: only associated `fn`, `const`, and `type` items can be `default`
error: item kind not supported in `extern` block
error: macro definition not supported in `extern` block
--> $DIR/default-on-wrong-item-kind.rs:64:5
|
LL | default macro_rules! foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: extern crate not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:70:5
|
LL | default extern crate foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: `use` import not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:72:5
|
LL | default use foo;
@ -370,73 +370,73 @@ error: associated `static` items are not allowed
LL | default static foo: u8;
| ^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: module not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:78:5
|
LL | default mod foo {}
| ^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: extern block not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:80:5
|
LL | default extern "C" {}
| ^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: enum not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:83:5
|
LL | default enum foo {}
| ^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: struct not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:85:5
|
LL | default struct foo {}
| ^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: union not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:87:5
|
LL | default union foo {}
| ^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: trait not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:89:5
|
LL | default trait foo {}
| ^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: trait alias not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:91:5
|
LL | default trait foo = Ord;
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: implementation not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:93:5
|
LL | default impl foo {}
| ^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: macro definition not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:99:5
|
LL | default macro foo {}
| ^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: macro definition not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:101:5
|
LL | default macro_rules! foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: extern crate not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:107:5
|
LL | default extern crate foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: `use` import not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:109:5
|
LL | default use foo;
@ -448,61 +448,61 @@ error: associated `static` items are not allowed
LL | default static foo: u8;
| ^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: module not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:115:5
|
LL | default mod foo {}
| ^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: extern block not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:117:5
|
LL | default extern "C" {}
| ^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: enum not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:120:5
|
LL | default enum foo {}
| ^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: struct not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:122:5
|
LL | default struct foo {}
| ^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: union not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:124:5
|
LL | default union foo {}
| ^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: trait not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:126:5
|
LL | default trait foo {}
| ^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: trait alias not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:128:5
|
LL | default trait foo = Ord;
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: implementation not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:130:5
|
LL | default impl foo {}
| ^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: macro definition not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:136:5
|
LL | default macro foo {}
| ^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: macro definition not supported in `trait` or `impl`
--> $DIR/default-on-wrong-item-kind.rs:138:5
|
LL | default macro_rules! foo {}

View file

@ -4,10 +4,10 @@ impl T for () { //~ ERROR cannot find trait `T` in this scope
fn foo(&self) {}
trait T { //~ ERROR item kind not supported in `trait` or `impl`
trait T { //~ ERROR trait not supported in `trait` or `impl`
fn foo(&self);
}
pub(crate) struct Bar<T>(); //~ ERROR item kind not supported in `trait` or `impl`
pub(crate) struct Bar<T>(); //~ ERROR struct not supported in `trait` or `impl`
//~ ERROR this file contains an unclosed delimiter

View file

@ -7,13 +7,13 @@ LL | impl T for () {
LL |
| ^
error: item kind not supported in `trait` or `impl`
error: trait not supported in `trait` or `impl`
--> $DIR/missing-close-brace-in-impl-trait.rs:7:1
|
LL | trait T {
| ^^^^^^^
error: item kind not supported in `trait` or `impl`
error: struct not supported in `trait` or `impl`
--> $DIR/missing-close-brace-in-impl-trait.rs:11:1
|
LL | pub(crate) struct Bar<T>();

View file

@ -2,10 +2,10 @@ trait T {
fn foo(&self);
pub(crate) struct Bar<T>();
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR struct not supported in `trait` or `impl`
impl T for Bar<usize> {
//~^ ERROR item kind not supported in `trait` or `impl`
//~^ ERROR implementation not supported in `trait` or `impl`
fn foo(&self) {}
}

View file

@ -7,13 +7,13 @@ LL | trait T {
LL | fn main() {}
| ^
error: item kind not supported in `trait` or `impl`
error: struct not supported in `trait` or `impl`
--> $DIR/missing-close-brace-in-trait.rs:4:1
|
LL | pub(crate) struct Bar<T>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: item kind not supported in `trait` or `impl`
error: implementation not supported in `trait` or `impl`
--> $DIR/missing-close-brace-in-trait.rs:7:1
|
LL | impl T for Bar<usize> {