aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-struct-field-expr.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-06-16 06:30:47 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-06-17 18:11:56 +0200
commit5f3c8286b225f3c87bed920f3c3e003a90d98722 (patch)
tree9eb1173fc07aa4fb713b572cb4b8da47e8b45fca /gcc/rust/backend/rust-compile-struct-field-expr.h
parent76f7e45179de4e6e53caab104022cc0784ecd618 (diff)
downloadgcc-5f3c8286b225f3c87bed920f3c3e003a90d98722.zip
gcc-5f3c8286b225f3c87bed920f3c3e003a90d98722.tar.gz
gcc-5f3c8286b225f3c87bed920f3c3e003a90d98722.tar.bz2
ast: Add const generic argument application type
This commit adds a new type to the AST which contains const generic arguments. The `GenericArgs` structure now also keeps a vector of them, and the parser was modified accordingly. We need to handle these extra arguments in the various resolvers and type-checking phase. As pointed out before, const generic arguments are ambiguous at the AST level. Which is why this "sum type" contains a "Clear" variant when there is no ambiguity at all (`<5>`, `<{ 5 }>`, `<{ 5 + 15 }>` or `<{ N }>`) and an "Ambiguous" one if the value in question might be referring to a type argument (`<N>`) instead of a const generic argument. However, when parsing a const generic declaration, we can also have a default value. Thus, we need a mechanism to disambiguate `ConstGenericArg`s early.
Diffstat (limited to 'gcc/rust/backend/rust-compile-struct-field-expr.h')
0 files changed, 0 insertions, 0 deletions