This website requires JavaScript.
Explore
Help
Register
Sign In
mikros
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
9aa4f6acb2
rust
/
tests
/
ui
/
pub
/
pub-ident-fn-or-struct.rs
5 lines
100 B
Rust
Raw
Normal View
History
Unescape
Escape
Do not attemt to continue parsing after `pub ident` Try to identify the following code in order to provide better diagnostics, but return the error to bail out early during the parse.
2017-11-21 10:03:02 -06:00
pub
S
(
foo
)
bar
Use appropriate terminology based on heuristic
2018-11-30 17:05:13 -06:00
//~^ ERROR missing `fn` or `struct` for function or struct definition
Do not rewind parser and ignore following blocks When encountering `pub ident`, attempt to identify the code that comes afterwards, wether it is a brace block (assume it is a struct), a paren list followed by a colon (assume struct) or a paren list followed by a block (assume a fn). Consume those blocks to avoid any further parser errors and return a `Placeholder` item in order to allow the parser to continue. In the case of unenclosed blocks, the behavior is the same as it is currently: no further errors are processed.
2017-11-21 08:49:15 -06:00
Do not attemt to continue parsing after `pub ident` Try to identify the following code in order to provide better diagnostics, but return the error to bail out early during the parse.
2017-11-21 10:03:02 -06:00
fn
main
(
)
{
}
Reference in New Issue
Copy Permalink