aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2023-07-18 12:12:22 +0100
committerPhilip Herron <philip.herron@embecosm.com>2023-07-29 23:51:27 +0000
commitf284cff3ff950198c9f175200deb8ca48d498921 (patch)
tree82eaa85a1ed9c7fdf918c4fdd79b859bd4e18691 /gcc/rust/resolve
parent7bb4d1b7502ce905f4fef89c7dba8b37cd12acdf (diff)
downloadgcc-f284cff3ff950198c9f175200deb8ca48d498921.zip
gcc-f284cff3ff950198c9f175200deb8ca48d498921.tar.gz
gcc-f284cff3ff950198c9f175200deb8ca48d498921.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/resolve')
0 files changed, 0 insertions, 0 deletions