diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-03-04 11:58:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-04 11:58:45 +0000 |
commit | d89c8ccf3237e66029125c0fe007297bb86eca74 (patch) | |
tree | 24926ddec8217cdba774a50eaa06383c8a72d13e /gcc/rust/util/rust-attributes.cc | |
parent | b4bd389c66a3e3bf0489626a1a70c2500d415ef8 (diff) | |
parent | d6e1771291c792f665f5b9ed7d065bf292051e6a (diff) | |
download | gcc-d89c8ccf3237e66029125c0fe007297bb86eca74.zip gcc-d89c8ccf3237e66029125c0fe007297bb86eca74.tar.gz gcc-d89c8ccf3237e66029125c0fe007297bb86eca74.tar.bz2 |
Merge #990
990: Add must use attribute support r=philberty a=philberty
This is a port of the CPP front-end nodiscard attribute to be used for
must_use. It contains a patch to clean up how we handle expressions vs
statements and removes more of the GCC abstraction. Its my hope that we
can leverage more and more existing code to get the static analysis where
we want it.
Fixes #856
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/util/rust-attributes.cc')
-rw-r--r-- | gcc/rust/util/rust-attributes.cc | 8 |
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 () |