]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Add trait context to ContextualASTVisitor
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 9 Nov 2023 18:45:08 +0000 (19:45 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:13:14 +0000 (19:13 +0100)
commitc1d722aa6f011a1584b1815bfbfb8d2733c1ba34
tree00f3b4324e2c6c914cfc76387106325400f228aa
parent119e0be8b6eea63a95c89d449c38aa133e6ad5ab
gccrs: Add trait context to ContextualASTVisitor

Some construct are forbidden in trait context (eg. pub, async...) and
we'll need to reject those. To do so we need to identify a trait context.

gcc/rust/ChangeLog:

* ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Push the new
trait context when visiting a trait.
* ast/rust-ast-visitor.h: Add visit function prototype and TRAIT
context.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-visitor.cc
gcc/rust/ast/rust-ast-visitor.h