-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[E0380] Use of auto trait with method or associated item #2527
Conversation
@MahadMuhammad is this ready to go? It looks good |
gcc/rust/parse/rust-parse-impl.h
Outdated
rust_error_at (locus, ErrorCode::E0380, | ||
"auto traits cannot have methods or associated items"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this does change the behavior of the code. add_error
adds the created error to an internal table in the parser, which can choose to emit them later on or not. so we need to keep using add_error
instead of rust_error_at
gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_trait): added errorcode & updated error message. gcc/testsuite/ChangeLog: * rust/compile/auto_trait_invalid.rs: Updated comment. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Use of auto trait with a method or an associated item -
E0380
add_error
torust_error_at
Running testcase:
gcc/testsuite/rust/compile/auto_trait_invalid.rs
gcc/rust/ChangeLog:
gcc/testsuite/ChangeLog: