diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2024-02-28 21:00:08 -0500 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2024-05-29 08:58:48 +0000 |
commit | 646046091b703621c4ba63adb76179c11a1dbb92 (patch) | |
tree | fe7de180536ae2808b74bb03aaeb54f15ed3471f /gcc/rust/util/rust-attributes.cc | |
parent | 9ade15d37ee0b09270fe0d0fbc9b000c943f2614 (diff) | |
download | gcc-646046091b703621c4ba63adb76179c11a1dbb92.zip gcc-646046091b703621c4ba63adb76179c11a1dbb92.tar.gz gcc-646046091b703621c4ba63adb76179c11a1dbb92.tar.bz2 |
Allow rustc_const_stable and rustc_const_unstable
gcc/rust/ChangeLog:
* expand/rust-macro-builtins.cc
(MacroBuiltin::builtin_transcribers):
Add entries for "rustc_const_stable" and "rustc_const_unstable".
* util/rust-attributes.cc
(__definitions): Add entries for RUSTC_CONST_STABLE and
RUSTC_CONST_UNSTABLE.
* util/rust-attribute-values.h
(Attributes::RUSTC_CONST_STABLE): New.
(Attributes::RUSTC_CONST_UNSTABLE): New.
gcc/testsuite/ChangeLog:
* rust/compile/rustc_const_stable.rs:
Enable feature rustc_attrs, expect no errors.
* rust/compile/rustc_const_unstable.rs: New test.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/util/rust-attributes.cc')
-rw-r--r-- | gcc/rust/util/rust-attributes.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 84d1781..3316667 100644 --- a/gcc/rust/util/rust-attributes.cc +++ b/gcc/rust/util/rust-attributes.cc @@ -61,7 +61,10 @@ static const BuiltinAttrDefinition __definitions[] {Attrs::RUSTC_DEPRECATED, STATIC_ANALYSIS}, {Attrs::RUSTC_INHERIT_OVERFLOW_CHECKS, CODE_GENERATION}, {Attrs::STABLE, STATIC_ANALYSIS}, - {Attrs::UNSTABLE, STATIC_ANALYSIS}}; + {Attrs::UNSTABLE, STATIC_ANALYSIS}, + // assuming we keep these for static analysis + {Attrs::RUSTC_CONST_STABLE, STATIC_ANALYSIS}, + {Attrs::RUSTC_CONST_UNSTABLE, STATIC_ANALYSIS}}; BuiltinAttributeMappings * BuiltinAttributeMappings::get () |