diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-08-21 15:42:58 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-19 15:32:04 +0100 |
commit | 85a3c48f51dbef4e74f806aca36825a6164db636 (patch) | |
tree | 0b72080356d4ac0670f68886987c5a2986308d66 /gcc/rust/backend | |
parent | 231b18b071b8a809765841461cd307770ae2ee8d (diff) | |
download | gcc-85a3c48f51dbef4e74f806aca36825a6164db636.zip gcc-85a3c48f51dbef4e74f806aca36825a6164db636.tar.gz gcc-85a3c48f51dbef4e74f806aca36825a6164db636.tar.bz2 |
gccrs: feature-gate: Cleanup visitor and constructor
This commit turns a few of the fields into `tl::optional<T>` and cleanups
the constructor with a couple default parameters. We can also reuse the
variable that we are `switch`ing on, instead of repeating the enum variants
each time.
Most importantly, the `FeatureGate` visitor now uses the `DefaultAstVisitor`
correctly, and will now visit nested items. This means that we have to
fix a bunch of the testsuite as some feature attributes were missing.
gcc/rust/ChangeLog:
* checks/errors/rust-feature.cc (Feature::create): Reuse variable,
remove now optional parameters from constructor.
* checks/errors/rust-feature.h: Cleanup class definition.
* checks/errors/rust-feature-gate.cc (FeatureGate::gate): Use optional.
* checks/errors/rust-feature-gate.h: Cleanup visitor implementation.
gcc/testsuite/ChangeLog:
* rust/compile/assume.rs: Add missing feature attribute.
* rust/compile/issue-1901.rs: Likewise.
* rust/compile/issue-1981.rs: Likewise.
* rust/compile/sizeof-stray-infer-var-bug.rs: Likewise.
* rust/compile/torture/intrinsics-8.rs: Likewise.
* rust/compile/torture/transmute-size-check-1.rs: Likewise.
* rust/compile/torture/transmute1.rs: Likewise.
* rust/compile/torture/uninit-intrinsic-1.rs: Likewise.
* rust/execute/torture/issue-1436.rs: Likewise.
* rust/execute/torture/issue-2583.rs: Likewise.
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions