Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gcc/rust/parse/rust-parse-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -4922,8 +4922,8 @@ Parser<ManagedTokenSource>::parse_trait (AST::Visibility vis,

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)
Expand Down
2 changes: 1 addition & 1 deletion gcc/testsuite/rust/compile/auto_trait_invalid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![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" }
Expand Down