aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/util/rust-attributes.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-03-03 09:23:06 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-03-03 11:08:18 +0000
commitd6e1771291c792f665f5b9ed7d065bf292051e6a (patch)
treed26c37ac592965fdb52caa73c41cd6e95ae322c8 /gcc/rust/util/rust-attributes.cc
parent57b50607988481238275d8a2f73722896cbe0fe2 (diff)
downloadgcc-d6e1771291c792f665f5b9ed7d065bf292051e6a.zip
gcc-d6e1771291c792f665f5b9ed7d065bf292051e6a.tar.gz
gcc-d6e1771291c792f665f5b9ed7d065bf292051e6a.tar.bz2
must use attribute support
This ports over the code from the cpp front-end which implements the cpp nodiscard attribute which has the same behaviour and is also implemented in the front-end explicitly. Fixes #856
Diffstat (limited to 'gcc/rust/util/rust-attributes.cc')
-rw-r--r--gcc/rust/util/rust-attributes.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 3809ad7..4f3bd0b 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -22,10 +22,10 @@ namespace Rust {
namespace Analysis {
// https://doc.rust-lang.org/stable/nightly-rustc/src/rustc_feature/builtin_attrs.rs.html#256
-static const BuiltinAttrDefinition __definitions[] = {
- {"inline", CODE_GENERATION}, {"cfg", EXPANSION}, {"cfg_attr", EXPANSION},
- {"allow", STATIC_ANALYSIS}, {"lang", HIR_LOWERING},
-};
+static const BuiltinAttrDefinition __definitions[]
+ = {{"inline", CODE_GENERATION}, {"cfg", EXPANSION},
+ {"cfg_attr", EXPANSION}, {"allow", STATIC_ANALYSIS},
+ {"lang", HIR_LOWERING}, {"must_use", STATIC_ANALYSIS}};
BuiltinAttributeMappings *
BuiltinAttributeMappings::get ()