| 1 |
// Copyright (C) 2020-2025 Free Software Foundation, Inc. |
| 2 |
|
| 3 |
// This file is part of GCC. |
| 4 |
|
| 5 |
// GCC is free software; you can redistribute it and/or modify it under |
| 6 |
// the terms of the GNU General Public License as published by the Free |
| 7 |
// Software Foundation; either version 3, or (at your option) any later |
| 8 |
// version. |
| 9 |
|
| 10 |
// GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
| 11 |
// WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 |
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 13 |
// for more details. |
| 14 |
|
| 15 |
// You should have received a copy of the GNU General Public License |
| 16 |
// along with GCC; see the file COPYING3. If not see |
| 17 |
// <http://www.gnu.org/licenses/>. |
| 18 |
|
| 19 |
#ifndef RUST_ATTRIBUTE_VALUES_H |
| 20 |
#define RUST_ATTRIBUTE_VALUES_H |
| 21 |
|
| 22 |
namespace Rust { |
| 23 |
namespace Values { |
| 24 |
// TODO: Change this to a namespace + inline constexpr in the future |
| 25 |
class Attributes |
| 26 |
{ |
| 27 |
public: |
| 28 |
static constexpr auto &INLINE = "inline"; |
| 29 |
static constexpr auto &COLD = "cold"; |
| 30 |
static constexpr auto &CFG = "cfg"; |
| 31 |
static constexpr auto &CFG_ATTR = "cfg_attr"; |
| 32 |
static constexpr auto &DERIVE_ATTR = "derive"; |
| 33 |
static constexpr auto &DEPRECATED = "deprecated"; |
| 34 |
static constexpr auto &ALLOW = "allow"; |
| 35 |
static constexpr auto &ALLOW_INTERNAL_UNSTABLE = "allow_internal_unstable"; |
| 36 |
static constexpr auto &DOC = "doc"; |
| 37 |
static constexpr auto &MUST_USE = "must_use"; |
| 38 |
static constexpr auto &LANG = "lang"; |
| 39 |
static constexpr auto &LINK_SECTION = "link_section"; |
| 40 |
static constexpr auto &NO_MANGLE = "no_mangle"; |
| 41 |
static constexpr auto &REPR = "repr"; |
| 42 |
static constexpr auto &RUSTC_BUILTIN_MACRO = "rustc_builtin_macro"; |
| 43 |
static constexpr auto &RUSTC_MACRO_TRANSPARENCY = "rustc_macro_transparency"; |
| 44 |
static constexpr auto &PATH = "path"; |
| 45 |
static constexpr auto &MACRO_USE = "macro_use"; |
| 46 |
static constexpr auto &MACRO_EXPORT = "macro_export"; |
| 47 |
static constexpr auto &PROC_MACRO = "proc_macro"; |
| 48 |
static constexpr auto &PROC_MACRO_DERIVE = "proc_macro_derive"; |
| 49 |
static constexpr auto &PROC_MACRO_ATTRIBUTE = "proc_macro_attribute"; |
| 50 |
|
| 51 |
static constexpr auto &TARGET_FEATURE = "target_feature"; |
| 52 |
// From now on, these are reserved by the compiler and gated through |
| 53 |
// #![feature(rustc_attrs)] |
| 54 |
static constexpr auto &RUSTC_DEPRECATED = "rustc_deprecated"; |
| 55 |
static constexpr auto &RUSTC_INHERIT_OVERFLOW_CHECKS |
| 56 |
= "rustc_inherit_overflow_checks"; |
| 57 |
static constexpr auto &STABLE = "stable"; |
| 58 |
static constexpr auto &UNSTABLE = "unstable"; |
| 59 |
|
| 60 |
static constexpr auto &RUSTC_PROMOTABLE = "rustc_promotable"; |
| 61 |
static constexpr auto &RUSTC_CONST_STABLE = "rustc_const_stable"; |
| 62 |
static constexpr auto &RUSTC_CONST_UNSTABLE = "rustc_const_unstable"; |
| 63 |
|
| 64 |
static constexpr auto &RUSTC_SPECIALIZATION_TRAIT |
| 65 |
= "rustc_specialization_trait"; |
| 66 |
static constexpr auto &RUSTC_UNSAFE_SPECIALIZATION_MARKER |
| 67 |
= "rustc_unsafe_specialization_marker"; |
| 68 |
static constexpr auto &RUSTC_RESERVATION_IMPL = "rustc_reservation_impl"; |
| 69 |
static constexpr auto &RUSTC_PAREN_SUGAR = "rustc_paren_sugar"; |
| 70 |
static constexpr auto &RUSTC_NONNULL_OPTIMIZATION_GUARANTEED |
| 71 |
= "rustc_nonnull_optimization_guaranteed"; |
| 72 |
|
| 73 |
static constexpr auto &RUSTC_LAYOUT_SCALAR_VALID_RANGE_START |
| 74 |
= "rustc_layout_scalar_valid_range_start"; |
| 75 |
|
| 76 |
static constexpr auto &MAY_DANGLE = "may_dangle"; |
| 77 |
static constexpr auto &PRELUDE_IMPORT = "prelude_import"; |
| 78 |
static constexpr auto &TRACK_CALLER = "track_caller"; |
| 79 |
|
| 80 |
static constexpr auto &RUSTC_DIAGNOSTIC_ITEM = "rustc_diagnostic_item"; |
| 81 |
static constexpr auto &RUSTC_ON_UNIMPLEMENTED = "rustc_on_unimplemented"; |
| 82 |
|
| 83 |
static constexpr auto &FUNDAMENTAL = "fundamental"; |
| 84 |
|
| 85 |
static constexpr auto &NON_EXHAUSTIVE = "non_exhaustive"; |
| 86 |
|
| 87 |
static constexpr auto &RUSTFMT = "rustfmt"; |
| 88 |
}; |
| 89 |
} // namespace Values |
| 90 |
} // namespace Rust |
| 91 |
|
| 92 |
#endif /* !RUST_ATTRIBUTE_VALUES_H */ |