diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-08-26 14:06:23 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-01-31 14:16:49 +0100 |
commit | 3a3a352091b74916c5ad3177e0df9d624d746cac (patch) | |
tree | a38404ed87f9428e7054b310ac3e88a8bd19bb74 /gcc/rust/util/rust-attributes.cc | |
parent | 9c87dc0afe059ce54280dd81ff773f910a6dffdf (diff) | |
download | gcc-3a3a352091b74916c5ad3177e0df9d624d746cac.zip gcc-3a3a352091b74916c5ad3177e0df9d624d746cac.tar.gz gcc-3a3a352091b74916c5ad3177e0df9d624d746cac.tar.bz2 |
gccrs: rustc_attrs: Allow `rustc_inherit_overflow_checks` as a builtin..
..attribute. We cannot yet handle this attribute, but we should not reject it either
gcc/rust/ChangeLog:
* util/rust-attributes.cc: Add `rustc_inherit_overflow_checks` to list
of builtin attributes.
gcc/testsuite/ChangeLog:
* rust/compile/rustc_attr1.rs: New test.
Diffstat (limited to 'gcc/rust/util/rust-attributes.cc')
-rw-r--r-- | gcc/rust/util/rust-attributes.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 2cefdb2..9db77b4 100644 --- a/gcc/rust/util/rust-attributes.cc +++ b/gcc/rust/util/rust-attributes.cc @@ -26,21 +26,23 @@ namespace Rust { namespace Analysis { // https://doc.rust-lang.org/stable/nightly-rustc/src/rustc_feature/builtin_attrs.rs.html#248 -static const BuiltinAttrDefinition __definitions[] = { - {"inline", CODE_GENERATION}, - {"cold", CODE_GENERATION}, - {"cfg", EXPANSION}, - {"cfg_attr", EXPANSION}, - {"deprecated", STATIC_ANALYSIS}, - {"allow", STATIC_ANALYSIS}, - {"doc", HIR_LOWERING}, - {"must_use", STATIC_ANALYSIS}, - {"lang", HIR_LOWERING}, - {"link_section", CODE_GENERATION}, - {"no_mangle", CODE_GENERATION}, - {"repr", CODE_GENERATION}, - {"path", EXPANSION}, -}; +static const BuiltinAttrDefinition __definitions[] + = {{"inline", CODE_GENERATION}, + {"cold", CODE_GENERATION}, + {"cfg", EXPANSION}, + {"cfg_attr", EXPANSION}, + {"deprecated", STATIC_ANALYSIS}, + {"allow", STATIC_ANALYSIS}, + {"doc", HIR_LOWERING}, + {"must_use", STATIC_ANALYSIS}, + {"lang", HIR_LOWERING}, + {"link_section", CODE_GENERATION}, + {"no_mangle", CODE_GENERATION}, + {"repr", CODE_GENERATION}, + {"path", EXPANSION}, + // From now on, these are reserved by the compiler and gated through + // #![feature(rustc_attrs)] + {"rustc_inherit_overflow_checks", CODE_GENERATION}}; BuiltinAttributeMappings * BuiltinAttributeMappings::get () |