gccrs: Reject auto traits with super trait
Reject auto traits containing a super trait bound during AST validation pass. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Reject auto traits with super traits. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
parent
3e0e74f3e9
commit
d8c1a756c4
1 changed files with 4 additions and 0 deletions
|
@ -105,6 +105,10 @@ ASTValidation::visit (AST::Trait &trait)
|
|||
rust_error_at (trait.get_generic_params ()[0]->get_locus (),
|
||||
ErrorCode::E0567,
|
||||
"auto traits cannot have generic parameters");
|
||||
if (trait.has_type_param_bounds ())
|
||||
rust_error_at (trait.get_type_param_bounds ()[0]->get_locus (),
|
||||
ErrorCode::E0568,
|
||||
"auto traits cannot have super traits");
|
||||
}
|
||||
|
||||
AST::ContextualASTVisitor::visit (trait);
|
||||
|
|
Loading…
Add table
Reference in a new issue