-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest an appropriate token when encountering
pub Ident<'a>
- Loading branch information
Showing
7 changed files
with
75 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pub foo<'a>(_s: &'a usize) -> bool { true } | ||
//~^ ERROR missing `fn` for method definition | ||
|
||
fn main() { | ||
foo(2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error: missing `fn` for method definition | ||
--> $DIR/pub-ident-fn-with-lifetime.rs:1:4 | ||
| | ||
LL | pub foo<'a>(_s: &'a usize) -> bool { true } | ||
| ^^^ | ||
help: add `fn` here to parse `foo` as a public method | ||
| | ||
LL | pub fn foo<'a>(_s: &'a usize) -> bool { true } | ||
| ^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pub S<'a> { | ||
//~^ ERROR missing `struct` for struct definition | ||
} | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error: missing `struct` for struct definition | ||
--> $DIR/pub-ident-struct-with-lifetime.rs:1:4 | ||
| | ||
LL | pub S<'a> { | ||
| ^ | ||
help: add `struct` here to parse `S` as a public struct | ||
| | ||
LL | pub struct S<'a> { | ||
| ^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fn main() { | ||
} | ||
|
||
pub foo<'a> | ||
//~^ ERROR missing `fn` or `struct` for method or struct definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: missing `fn` or `struct` for method or struct definition | ||
--> $DIR/pub-ident-with-lifetime-incomplete.rs:4:4 | ||
| | ||
LL | pub foo<'a> | ||
| ^^^ | ||
|
||
error: aborting due to previous error | ||
|