Skip to content

Commit abc46a5

Browse files
committed
parse: harden default test.
1 parent a3b0829 commit abc46a5

File tree

2 files changed

+96
-56
lines changed

2 files changed

+96
-56
lines changed

src/test/ui/parser/default-on-wrong-item-kind.rs

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ mod free_items {
2222
default impl foo {}
2323
default!();
2424
default::foo::bar!();
25+
default default!(); //~ ERROR item cannot be `default`
26+
default default::foo::bar!(); //~ ERROR item cannot be `default`
2527
default macro foo {} //~ ERROR item cannot be `default`
2628
default macro_rules! foo {} //~ ERROR item cannot be `default`
2729
}
@@ -55,6 +57,8 @@ extern "C" {
5557
//~^ ERROR item kind not supported in `extern` block
5658
default!();
5759
default::foo::bar!();
60+
default default!(); //~ ERROR item cannot be `default`
61+
default default::foo::bar!(); //~ ERROR item cannot be `default`
5862
default macro foo {} //~ ERROR item cannot be `default`
5963
//~^ ERROR item kind not supported in `extern` block
6064
default macro_rules! foo {} //~ ERROR item cannot be `default`
@@ -90,6 +94,8 @@ impl S {
9094
//~^ ERROR item kind not supported in `trait` or `impl`
9195
default!();
9296
default::foo::bar!();
97+
default default!();
98+
default default::foo::bar!();
9399
default macro foo {}
94100
//~^ ERROR item kind not supported in `trait` or `impl`
95101
default macro_rules! foo {}
@@ -125,6 +131,8 @@ trait T {
125131
//~^ ERROR item kind not supported in `trait` or `impl`
126132
default!();
127133
default::foo::bar!();
134+
default default!();
135+
default default::foo::bar!();
128136
default macro foo {}
129137
//~^ ERROR item kind not supported in `trait` or `impl`
130138
default macro_rules! foo {}

0 commit comments

Comments
 (0)