diff --git a/gcc/rust/checks/errors/rust-ast-validation.cc b/gcc/rust/checks/errors/rust-ast-validation.cc index aeae6035db8f..0604c5673964 100644 --- a/gcc/rust/checks/errors/rust-ast-validation.cc +++ b/gcc/rust/checks/errors/rust-ast-validation.cc @@ -109,6 +109,9 @@ ASTValidation::visit (AST::Trait &trait) rust_error_at (trait.get_type_param_bounds ()[0]->get_locus (), ErrorCode::E0568, "auto traits cannot have super traits"); + if (trait.has_trait_items ()) + rust_error_at (trait.get_locus (), ErrorCode::E0380, + "auto traits cannot have methods or associated items"); } AST::ContextualASTVisitor::visit (trait);