parse: use parse_item_common in parse_assoc_item_.
This commit is contained in:
parent
a63f35daee
commit
a05c83b2eb
38 changed files with 669 additions and 287 deletions
|
|
@ -9,8 +9,14 @@ LL | fn b(self>
|
|||
error: expected `;` or `{`, found `>`
|
||||
--> $DIR/issue-58856-1.rs:3:14
|
||||
|
|
||||
LL | impl A {
|
||||
| - while parsing this item list starting here
|
||||
LL |
|
||||
LL | fn b(self>
|
||||
| ^ expected `;` or `{`
|
||||
...
|
||||
LL | }
|
||||
| - the item list ends here
|
||||
|
||||
error[E0412]: cannot find type `A` in this scope
|
||||
--> $DIR/issue-58856-1.rs:1:6
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@ impl Howness for () {
|
|||
Empty
|
||||
}
|
||||
}
|
||||
//~^ ERROR expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`,
|
||||
//~^ ERROR non-item in item list
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -7,13 +7,17 @@ LL | fn how_are_you(&self -> Empty {
|
|||
| | help: `)` may belong here
|
||||
| unclosed delimiter
|
||||
|
||||
error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `static`, `type`, `unsafe`, `}`, or identifier, found `)`
|
||||
error: non-item in item list
|
||||
--> $DIR/issue-58856-2.rs:11:1
|
||||
|
|
||||
LL | }
|
||||
| - expected one of 12 possible tokens
|
||||
LL | impl Howness for () {
|
||||
| - item list starts here
|
||||
...
|
||||
LL | }
|
||||
| ^ unexpected token
|
||||
| ^
|
||||
| |
|
||||
| non-item starts here
|
||||
| item list ends here
|
||||
|
||||
error[E0407]: method `how_are_you` is not a member of trait `Howness`
|
||||
--> $DIR/issue-58856-2.rs:6:5
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ trait T {
|
|||
fn qux() -> Option<usize> {
|
||||
let _ = if true {
|
||||
});
|
||||
//~^ ERROR expected one of `async`
|
||||
//~| ERROR expected one of `.`, `;`, `?`, `else`, or an operator, found `}`
|
||||
//~^ ERROR non-item in item list
|
||||
//~| ERROR mismatched closing delimiter: `)`
|
||||
//~| ERROR expected one of `.`, `;`
|
||||
Some(4)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,26 @@ error: expected one of `.`, `;`, `?`, `else`, or an operator, found `}`
|
|||
LL | });
|
||||
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
|
||||
|
||||
error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `static`, `type`, `unsafe`, `}`, or identifier, found `;`
|
||||
error: non-item in item list
|
||||
--> $DIR/issue-60075.rs:6:11
|
||||
|
|
||||
LL | trait T {
|
||||
| - item list starts here
|
||||
...
|
||||
LL | });
|
||||
| ^ non-item starts here
|
||||
...
|
||||
LL | }
|
||||
| - item list ends here
|
||||
|
||||
error: mismatched closing delimiter: `)`
|
||||
--> $DIR/issue-60075.rs:6:10
|
||||
|
|
||||
LL | fn qux() -> Option<usize> {
|
||||
| - unclosed delimiter
|
||||
LL | let _ = if true {
|
||||
LL | });
|
||||
| ^ help: `}` may belong here
|
||||
| ^ mismatched closing delimiter
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue