diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-07-18 12:12:22 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:56:03 +0100 |
commit | c533a11ae05bae53e4421810f7108aac697ded4e (patch) | |
tree | 6dbafe851429fa38d0286cd918ae0f1b5faf23f1 /gcc/rust/util/rust-hir-map.h | |
parent | 2b00b13d309f600fee94cc911a99362e0451cbaa (diff) | |
download | gcc-c533a11ae05bae53e4421810f7108aac697ded4e.zip gcc-c533a11ae05bae53e4421810f7108aac697ded4e.tar.gz gcc-c533a11ae05bae53e4421810f7108aac697ded4e.tar.bz2 |
gccrs: Track trait bound polarity properly
Trait bounds can have three forms in Rust the regular trait bound, '!' the
negative trait bound to enforice that this trait must not be implmented and
'?' the anti trait bound to remove this bound. This patch extends our
Polarity enum to include the Anti trait bound and updates the HIR lowering
code to track this properly.
Addresses #2443
gcc/rust/ChangeLog:
* hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): use new BoundPolarity enum
* hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): likewise
* hir/rust-hir-dump.cc (BoundPolarityString): new helper
(Dump::visit): update hir dump
* hir/tree/rust-hir-item.h (class ImplBlock): likewise
* hir/tree/rust-hir-type.h (class TraitBound): likewise
* hir/tree/rust-hir.cc (TraitBound::as_string): fix as string
* util/rust-common.h (enum Polarity): add new anti bound
(enum BoundPolarity): likewise
* util/rust-hir-map.cc (Mappings::Mappings): update naming
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/util/rust-hir-map.h')
0 files changed, 0 insertions, 0 deletions