1
Fork 0

parse: tweak diagnostic wordings

This commit is contained in:
Mazdak Farrokhzad 2020-02-23 12:54:00 +01:00
parent e66a39bb65
commit fde5939d1c
23 changed files with 103 additions and 103 deletions

View file

@ -112,7 +112,7 @@ impl<'a> Parser<'a> {
} }
let vs = pprust::vis_to_string(&vis); let vs = pprust::vis_to_string(&vis);
let vs = vs.trim_end(); let vs = vs.trim_end();
self.struct_span_err(vis.span, &format!("visibility `{}` not followed by an item", vs)) self.struct_span_err(vis.span, &format!("visibility `{}` is not followed by an item", vs))
.span_label(vis.span, "the visibility") .span_label(vis.span, "the visibility")
.help(&format!("you likely meant to define an item, e.g., `{} fn foo() {{}}`", vs)) .help(&format!("you likely meant to define an item, e.g., `{} fn foo() {{}}`", vs))
.emit(); .emit();
@ -121,7 +121,7 @@ impl<'a> Parser<'a> {
/// Error in-case a `default` was parsed but no item followed. /// Error in-case a `default` was parsed but no item followed.
fn error_on_unmatched_defaultness(&self, def: Defaultness) { fn error_on_unmatched_defaultness(&self, def: Defaultness) {
if let Defaultness::Default(sp) = def { if let Defaultness::Default(sp) = def {
self.struct_span_err(sp, "`default` not followed by an item") self.struct_span_err(sp, "`default` is not followed by an item")
.span_label(sp, "the `default` qualifier") .span_label(sp, "the `default` qualifier")
.note("only `fn`, `const`, `type`, or `impl` items may be prefixed by `default`") .note("only `fn`, `const`, `type`, or `impl` items may be prefixed by `default`")
.emit(); .emit();
@ -657,7 +657,7 @@ impl<'a> Parser<'a> {
self.struct_span_err(span, "associated `static` items are not allowed").emit(); self.struct_span_err(span, "associated `static` items are not allowed").emit();
AssocItemKind::Const(Defaultness::Final, a, b) AssocItemKind::Const(Defaultness::Final, a, b)
} }
_ => return self.error_bad_item_kind(span, &kind, "`trait` or `impl`"), _ => return self.error_bad_item_kind(span, &kind, "`trait`s or `impl`s"),
}; };
Some(P(Item { attrs, id, span, vis, ident, kind, tokens })) Some(P(Item { attrs, id, span, vis, ident, kind, tokens }))
})) }))
@ -846,7 +846,7 @@ impl<'a> Parser<'a> {
self.error_on_foreign_const(span, ident); self.error_on_foreign_const(span, ident);
ForeignItemKind::Static(a, Mutability::Not, b) ForeignItemKind::Static(a, Mutability::Not, b)
} }
_ => return self.error_bad_item_kind(span, &kind, "`extern` block"), _ => return self.error_bad_item_kind(span, &kind, "`extern` blocks"),
}; };
Some(P(Item { attrs, id, span, vis, ident, kind, tokens })) Some(P(Item { attrs, id, span, vis, ident, kind, tokens }))
})) }))
@ -854,7 +854,7 @@ impl<'a> Parser<'a> {
fn error_bad_item_kind<T>(&self, span: Span, kind: &ItemKind, ctx: &str) -> Option<T> { fn error_bad_item_kind<T>(&self, span: Span, kind: &ItemKind, ctx: &str) -> Option<T> {
let span = self.sess.source_map().def_span(span); let span = self.sess.source_map().def_span(span);
let msg = format!("{} not supported in {}", kind.descr(), ctx); let msg = format!("{} is not supported in {}", kind.descr(), ctx);
self.struct_span_err(span, &msg).emit(); self.struct_span_err(span, &msg).emit();
return None; return None;
} }

View file

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

View file

@ -118,7 +118,7 @@ LL | default extern crate foo;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: extern crate not supported in `extern` block error: extern crate is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:33:5 --> $DIR/default-on-wrong-item-kind.rs:33:5
| |
LL | default extern crate foo; LL | default extern crate foo;
@ -132,7 +132,7 @@ LL | default use foo;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: `use` import not supported in `extern` block error: `use` import is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:35:5 --> $DIR/default-on-wrong-item-kind.rs:35:5
| |
LL | default use foo; LL | default use foo;
@ -164,7 +164,7 @@ LL | default mod foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: module not supported in `extern` block error: module is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:41:5 --> $DIR/default-on-wrong-item-kind.rs:41:5
| |
LL | default mod foo {} LL | default mod foo {}
@ -178,7 +178,7 @@ LL | default extern "C" {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: extern block not supported in `extern` block error: extern block is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:43:5 --> $DIR/default-on-wrong-item-kind.rs:43:5
| |
LL | default extern "C" {} LL | default extern "C" {}
@ -192,7 +192,7 @@ LL | default enum foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: enum not supported in `extern` block error: enum is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:46:5 --> $DIR/default-on-wrong-item-kind.rs:46:5
| |
LL | default enum foo {} LL | default enum foo {}
@ -206,7 +206,7 @@ LL | default struct foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: struct not supported in `extern` block error: struct is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:48:5 --> $DIR/default-on-wrong-item-kind.rs:48:5
| |
LL | default struct foo {} LL | default struct foo {}
@ -220,7 +220,7 @@ LL | default union foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: union not supported in `extern` block error: union is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:50:5 --> $DIR/default-on-wrong-item-kind.rs:50:5
| |
LL | default union foo {} LL | default union foo {}
@ -234,7 +234,7 @@ LL | default trait foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: trait not supported in `extern` block error: trait is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:52:5 --> $DIR/default-on-wrong-item-kind.rs:52:5
| |
LL | default trait foo {} LL | default trait foo {}
@ -248,13 +248,13 @@ LL | default trait foo = Ord;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: trait alias not supported in `extern` block error: trait alias is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:54:5 --> $DIR/default-on-wrong-item-kind.rs:54:5
| |
LL | default trait foo = Ord; LL | default trait foo = Ord;
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation not supported in `extern` block error: implementation is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:56:5 --> $DIR/default-on-wrong-item-kind.rs:56:5
| |
LL | default impl foo {} LL | default impl foo {}
@ -284,7 +284,7 @@ LL | default macro foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: macro definition not supported in `extern` block error: macro definition is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:62:5 --> $DIR/default-on-wrong-item-kind.rs:62:5
| |
LL | default macro foo {} LL | default macro foo {}
@ -298,7 +298,7 @@ LL | default macro_rules! foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: macro definition not supported in `extern` block error: macro definition is not supported in `extern` blocks
--> $DIR/default-on-wrong-item-kind.rs:64:5 --> $DIR/default-on-wrong-item-kind.rs:64:5
| |
LL | default macro_rules! foo {} LL | default macro_rules! foo {}
@ -312,7 +312,7 @@ LL | default extern crate foo;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: extern crate not supported in `trait` or `impl` error: extern crate is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:70:5 --> $DIR/default-on-wrong-item-kind.rs:70:5
| |
LL | default extern crate foo; LL | default extern crate foo;
@ -326,7 +326,7 @@ LL | default use foo;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: `use` import not supported in `trait` or `impl` error: `use` import is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:72:5 --> $DIR/default-on-wrong-item-kind.rs:72:5
| |
LL | default use foo; LL | default use foo;
@ -354,7 +354,7 @@ LL | default mod foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: module not supported in `trait` or `impl` error: module is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:78:5 --> $DIR/default-on-wrong-item-kind.rs:78:5
| |
LL | default mod foo {} LL | default mod foo {}
@ -368,7 +368,7 @@ LL | default extern "C" {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: extern block not supported in `trait` or `impl` error: extern block is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:80:5 --> $DIR/default-on-wrong-item-kind.rs:80:5
| |
LL | default extern "C" {} LL | default extern "C" {}
@ -382,7 +382,7 @@ LL | default enum foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: enum not supported in `trait` or `impl` error: enum is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:83:5 --> $DIR/default-on-wrong-item-kind.rs:83:5
| |
LL | default enum foo {} LL | default enum foo {}
@ -396,7 +396,7 @@ LL | default struct foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: struct not supported in `trait` or `impl` error: struct is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:85:5 --> $DIR/default-on-wrong-item-kind.rs:85:5
| |
LL | default struct foo {} LL | default struct foo {}
@ -410,7 +410,7 @@ LL | default union foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: union not supported in `trait` or `impl` error: union is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:87:5 --> $DIR/default-on-wrong-item-kind.rs:87:5
| |
LL | default union foo {} LL | default union foo {}
@ -424,7 +424,7 @@ LL | default trait foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: trait not supported in `trait` or `impl` error: trait is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:89:5 --> $DIR/default-on-wrong-item-kind.rs:89:5
| |
LL | default trait foo {} LL | default trait foo {}
@ -438,13 +438,13 @@ LL | default trait foo = Ord;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: trait alias not supported in `trait` or `impl` error: trait alias is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:91:5 --> $DIR/default-on-wrong-item-kind.rs:91:5
| |
LL | default trait foo = Ord; LL | default trait foo = Ord;
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation not supported in `trait` or `impl` error: implementation is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:93:5 --> $DIR/default-on-wrong-item-kind.rs:93:5
| |
LL | default impl foo {} LL | default impl foo {}
@ -474,7 +474,7 @@ LL | default macro foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: macro definition not supported in `trait` or `impl` error: macro definition is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:99:5 --> $DIR/default-on-wrong-item-kind.rs:99:5
| |
LL | default macro foo {} LL | default macro foo {}
@ -488,7 +488,7 @@ LL | default macro_rules! foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: macro definition not supported in `trait` or `impl` error: macro definition is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:101:5 --> $DIR/default-on-wrong-item-kind.rs:101:5
| |
LL | default macro_rules! foo {} LL | default macro_rules! foo {}
@ -502,7 +502,7 @@ LL | default extern crate foo;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: extern crate not supported in `trait` or `impl` error: extern crate is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:107:5 --> $DIR/default-on-wrong-item-kind.rs:107:5
| |
LL | default extern crate foo; LL | default extern crate foo;
@ -516,7 +516,7 @@ LL | default use foo;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: `use` import not supported in `trait` or `impl` error: `use` import is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:109:5 --> $DIR/default-on-wrong-item-kind.rs:109:5
| |
LL | default use foo; LL | default use foo;
@ -544,7 +544,7 @@ LL | default mod foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: module not supported in `trait` or `impl` error: module is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:115:5 --> $DIR/default-on-wrong-item-kind.rs:115:5
| |
LL | default mod foo {} LL | default mod foo {}
@ -558,7 +558,7 @@ LL | default extern "C" {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: extern block not supported in `trait` or `impl` error: extern block is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:117:5 --> $DIR/default-on-wrong-item-kind.rs:117:5
| |
LL | default extern "C" {} LL | default extern "C" {}
@ -572,7 +572,7 @@ LL | default enum foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: enum not supported in `trait` or `impl` error: enum is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:120:5 --> $DIR/default-on-wrong-item-kind.rs:120:5
| |
LL | default enum foo {} LL | default enum foo {}
@ -586,7 +586,7 @@ LL | default struct foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: struct not supported in `trait` or `impl` error: struct is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:122:5 --> $DIR/default-on-wrong-item-kind.rs:122:5
| |
LL | default struct foo {} LL | default struct foo {}
@ -600,7 +600,7 @@ LL | default union foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: union not supported in `trait` or `impl` error: union is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:124:5 --> $DIR/default-on-wrong-item-kind.rs:124:5
| |
LL | default union foo {} LL | default union foo {}
@ -614,7 +614,7 @@ LL | default trait foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: trait not supported in `trait` or `impl` error: trait is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:126:5 --> $DIR/default-on-wrong-item-kind.rs:126:5
| |
LL | default trait foo {} LL | default trait foo {}
@ -628,13 +628,13 @@ LL | default trait foo = Ord;
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: trait alias not supported in `trait` or `impl` error: trait alias is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:128:5 --> $DIR/default-on-wrong-item-kind.rs:128:5
| |
LL | default trait foo = Ord; LL | default trait foo = Ord;
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation not supported in `trait` or `impl` error: implementation is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:130:5 --> $DIR/default-on-wrong-item-kind.rs:130:5
| |
LL | default impl foo {} LL | default impl foo {}
@ -664,7 +664,7 @@ LL | default macro foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: macro definition not supported in `trait` or `impl` error: macro definition is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:136:5 --> $DIR/default-on-wrong-item-kind.rs:136:5
| |
LL | default macro foo {} LL | default macro foo {}
@ -678,7 +678,7 @@ LL | default macro_rules! foo {}
| |
= note: only associated `fn`, `const`, and `type` items can be `default` = note: only associated `fn`, `const`, and `type` items can be `default`
error: macro definition not supported in `trait` or `impl` error: macro definition is not supported in `trait`s or `impl`s
--> $DIR/default-on-wrong-item-kind.rs:138:5 --> $DIR/default-on-wrong-item-kind.rs:138:5
| |
LL | default macro_rules! foo {} LL | default macro_rules! foo {}

View file

@ -3,7 +3,7 @@ fn main() {}
trait Foo { trait Foo {
default!(); //~ ERROR cannot find macro `default` in this scope default!(); //~ ERROR cannot find macro `default` in this scope
default do default do
//~^ ERROR `default` not followed by an item //~^ ERROR `default` is not followed by an item
//~| ERROR non-item in item list //~| ERROR non-item in item list
} }
@ -11,6 +11,6 @@ struct S;
impl S { impl S {
default!(); //~ ERROR cannot find macro `default` in this scope default!(); //~ ERROR cannot find macro `default` in this scope
default do default do
//~^ ERROR `default` not followed by an item //~^ ERROR `default` is not followed by an item
//~| ERROR non-item in item list //~| ERROR non-item in item list
} }

View file

@ -1,4 +1,4 @@
error: `default` not followed by an item error: `default` is not followed by an item
--> $DIR/default-unmatched-assoc.rs:5:5 --> $DIR/default-unmatched-assoc.rs:5:5
| |
LL | default do LL | default do
@ -18,7 +18,7 @@ LL | default do
LL | } LL | }
| - item list ends here | - item list ends here
error: `default` not followed by an item error: `default` is not followed by an item
--> $DIR/default-unmatched-assoc.rs:13:5 --> $DIR/default-unmatched-assoc.rs:13:5
| |
LL | default do LL | default do

View file

@ -3,6 +3,6 @@ fn main() {}
extern "C" { extern "C" {
default!(); //~ ERROR cannot find macro `default` in this scope default!(); //~ ERROR cannot find macro `default` in this scope
default do default do
//~^ ERROR `default` not followed by an item //~^ ERROR `default` is not followed by an item
//~| ERROR non-item in item list //~| ERROR non-item in item list
} }

View file

@ -1,4 +1,4 @@
error: `default` not followed by an item error: `default` is not followed by an item
--> $DIR/default-unmatched-extern.rs:5:5 --> $DIR/default-unmatched-extern.rs:5:5
| |
LL | default do LL | default do

View file

@ -1,6 +1,6 @@
mod foo { mod foo {
default!(); // OK. default!(); // OK.
default do default do
//~^ ERROR `default` not followed by an item //~^ ERROR `default` is not followed by an item
//~| ERROR expected item, found reserved keyword `do` //~| ERROR expected item, found reserved keyword `do`
} }

View file

@ -1,4 +1,4 @@
error: `default` not followed by an item error: `default` is not followed by an item
--> $DIR/default-unmatched.rs:3:5 --> $DIR/default-unmatched.rs:3:5
| |
LL | default do LL | default do

View file

@ -20,7 +20,7 @@ impl Foo for u16 {
impl Foo for u32 { //~ ERROR not all trait items implemented, missing: `foo` impl Foo for u32 { //~ ERROR not all trait items implemented, missing: `foo`
default pub fn foo<T: Default>() -> T { T::default() } default pub fn foo<T: Default>() -> T { T::default() }
//~^ ERROR `default` not followed by an item //~^ ERROR `default` is not followed by an item
//~| ERROR non-item in item list //~| ERROR non-item in item list
} }

View file

@ -1,4 +1,4 @@
error: `default` not followed by an item error: `default` is not followed by an item
--> $DIR/default.rs:22:5 --> $DIR/default.rs:22:5
| |
LL | default pub fn foo<T: Default>() -> T { T::default() } LL | default pub fn foo<T: Default>() -> T { T::default() }

View file

@ -2,6 +2,6 @@ fn main() {}
extern { extern {
pub pub fn foo(); pub pub fn foo();
//~^ ERROR visibility `pub` not followed by an item //~^ ERROR visibility `pub` is not followed by an item
//~| ERROR non-item in item list //~| ERROR non-item in item list
} }

View file

@ -1,4 +1,4 @@
error: visibility `pub` not followed by an item error: visibility `pub` is not followed by an item
--> $DIR/duplicate-visibility.rs:4:5 --> $DIR/duplicate-visibility.rs:4:5
| |
LL | pub pub fn foo(); LL | pub pub fn foo();

View file

@ -7,4 +7,4 @@ impl ?Sized for Type {} //~ ERROR expected a trait, found type
impl ?Sized for .. {} //~ ERROR expected a trait, found type impl ?Sized for .. {} //~ ERROR expected a trait, found type
default unsafe FAIL //~ ERROR expected item, found keyword `unsafe` default unsafe FAIL //~ ERROR expected item, found keyword `unsafe`
//~^ ERROR `default` not followed by an item //~^ ERROR `default` is not followed by an item

View file

@ -22,7 +22,7 @@ error: expected a trait, found type
LL | impl ?Sized for .. {} LL | impl ?Sized for .. {}
| ^^^^^^ | ^^^^^^
error: `default` not followed by an item error: `default` is not followed by an item
--> $DIR/impl-parsing.rs:9:1 --> $DIR/impl-parsing.rs:9:1
| |
LL | default unsafe FAIL LL | default unsafe FAIL

View file

@ -1,7 +1,7 @@
struct S; struct S;
impl S { impl S {
pub //~ ERROR visibility `pub` not followed by an item pub //~ ERROR visibility `pub` is not followed by an item
} //~ ERROR non-item in item list } //~ ERROR non-item in item list
fn main() {} fn main() {}

View file

@ -1,4 +1,4 @@
error: visibility `pub` not followed by an item error: visibility `pub` is not followed by an item
--> $DIR/issue-41155.rs:4:5 --> $DIR/issue-41155.rs:4:5
| |
LL | pub LL | pub

View file

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

View file

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

View file

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

View file

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

View file

@ -1,2 +1,2 @@
pub(crate) () fn foo() {} //~ ERROR visibility `pub(crate)` not followed by an item pub(crate) () fn foo() {} //~ ERROR visibility `pub(crate)` is not followed by an item
//~^ ERROR expected item, found `(` //~^ ERROR expected item, found `(`

View file

@ -1,4 +1,4 @@
error: visibility `pub(crate)` not followed by an item error: visibility `pub(crate)` is not followed by an item
--> $DIR/pub-restricted-error-fn.rs:1:1 --> $DIR/pub-restricted-error-fn.rs:1:1
| |
LL | pub(crate) () fn foo() {} LL | pub(crate) () fn foo() {}