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>
if (is_auto_trait && !trait_items.empty ())
{
- add_error (
- Error (locus, "associated items are forbidden within auto traits"));
+ add_error (Error (locus, ErrorCode::E0380,
+ "auto traits cannot have associated items"));
// FIXME: unsure if this should be done at parsing time or not
for (const auto &item : trait_items)
#![feature(optin_builtin_traits)]
-unsafe auto trait Invalid { // { dg-error "associated items are forbidden within auto traits" }
+unsafe auto trait Invalid { // { dg-error "auto traits cannot have associated items" }
fn foo(); // { dg-message "remove this item" }
fn bar() {} // { dg-message "remove this item" }