Skip to content

Commit fef1a2d

Browse files
committed
accept unhandled features
1 parent 7aa2aab commit fef1a2d

File tree

2 files changed

+165
-0
lines changed

2 files changed

+165
-0
lines changed

gcc/rust/checks/errors/rust-feature.cc

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,89 @@ const std::map<std::string, Feature::Name> Feature::name_hash_map = {
8484
{"exclusive_range_pattern", Feature::Name::EXCLUSIVE_RANGE_PATTERN},
8585
{"prelude_import", Feature::Name::PRELUDE_IMPORT},
8686
{"min_specialization", Feature::Name::MIN_SPECIALIZATION},
87+
// unhandled features
88+
{"aarch64_target_feature", Feature::Name::AARCH64_TARGET_FEATURE},
89+
{"abi_unadjusted", Feature::Name::ABI_UNADJUSTED},
90+
{"adx_target_feature", Feature::Name::ADX_TARGET_FEATURE},
91+
{"allow_internal_unstable", Feature::Name::ALLOW_INTERNAL_UNSTABLE},
92+
{"arbitrary_self_types", Feature::Name::ARBITRARY_SELF_TYPES},
93+
{"arm_target_feature", Feature::Name::ARM_TARGET_FEATURE},
94+
{"asm", Feature::Name::ASM},
95+
{"avx512_target_feature", Feature::Name::AVX512_TARGET_FEATURE},
96+
{"cfg_target_has_atomic", Feature::Name::CFG_TARGET_HAS_ATOMIC},
97+
{"cmpxchg16b_target_feature", Feature::Name::CMPXCHG16B_TARGET_FEATURE},
98+
{"const_align_of_val", Feature::Name::CONST_ALIGN_OF_VAL},
99+
{"const_alloc_layout", Feature::Name::CONST_ALLOC_LAYOUT},
100+
{"const_caller_location", Feature::Name::CONST_CALLER_LOCATION},
101+
{"const_cell_into_inner", Feature::Name::CONST_CELL_INTO_INNER},
102+
{"const_checked_int_methods", Feature::Name::CONST_CHECKED_INT_METHODS},
103+
{"const_discriminant", Feature::Name::CONST_DISCRIMINANT},
104+
{"const_euclidean_int_methods", Feature::Name::CONST_EUCLIDEAN_INT_METHODS},
105+
{"const_float_bits_conv", Feature::Name::CONST_FLOAT_BITS_CONV},
106+
{"const_float_classify", Feature::Name::CONST_FLOAT_CLASSIFY},
107+
{"const_fn", Feature::Name::CONST_FN},
108+
{"const_fn_floating_point_arithmetic", Feature::Name::CONST_FN_FLOATING_POINT_ARITHMETIC},
109+
{"const_fn_fn_ptr_basics", Feature::Name::CONST_FN_FN_PTR_BASICS},
110+
{"const_fn_transmute", Feature::Name::CONST_FN_TRANSMUTE},
111+
{"const_fn_union", Feature::Name::CONST_FN_UNION},
112+
{"const_generics", Feature::Name::CONST_GENERICS},
113+
{"const_int_pow", Feature::Name::CONST_INT_POW},
114+
{"const_int_unchecked_arith", Feature::Name::CONST_INT_UNCHECKED_ARITH},
115+
{"const_likely", Feature::Name::CONST_LIKELY},
116+
{"const_mut_refs", Feature::Name::CONST_MUT_REFS},
117+
{"const_option", Feature::Name::CONST_OPTION},
118+
{"const_overflowing_int_methods", Feature::Name::CONST_OVERFLOWING_INT_METHODS},
119+
{"const_panic", Feature::Name::CONST_PANIC},
120+
{"const_pin", Feature::Name::CONST_PIN},
121+
{"const_precise_live_drops", Feature::Name::CONST_PRECISE_LIVE_DROPS},
122+
{"const_ptr_offset", Feature::Name::CONST_PTR_OFFSET},
123+
{"const_ptr_offset_from", Feature::Name::CONST_PTR_OFFSET_FROM},
124+
{"const_raw_ptr_comparison", Feature::Name::CONST_RAW_PTR_COMPARISON},
125+
{"const_size_of_val", Feature::Name::CONST_SIZE_OF_VAL},
126+
{"const_slice_from_raw_parts", Feature::Name::CONST_SLICE_FROM_RAW_PARTS},
127+
{"const_slice_ptr_len", Feature::Name::CONST_SLICE_PTR_LEN},
128+
{"const_type_id", Feature::Name::CONST_TYPE_ID},
129+
{"const_type_name", Feature::Name::CONST_TYPE_NAME},
130+
{"const_unreachable_unchecked", Feature::Name::CONST_UNREACHABLE_UNCHECKED},
131+
{"constctlz", Feature::Name::CONSTCTLZ},
132+
{"custom_inner_attributes", Feature::Name::CUSTOM_INNER_ATTRIBUTES},
133+
{"doc_cfg", Feature::Name::DOC_CFG},
134+
{"doc_spotlight", Feature::Name::DOC_SPOTLIGHT},
135+
{"duration_consts_2", Feature::Name::DURATION_CONSTS_2},
136+
{"duration_saturating_ops", Feature::Name::DURATION_SATURATING_OPS},
137+
{"exhaustive_patterns", Feature::Name::EXHAUSTIVE_PATTERNS},
138+
{"external_doc", Feature::Name::EXTERNAL_DOC},
139+
{"f16c_target_feature", Feature::Name::F16C_TARGET_FEATURE},
140+
{"fundamental", Feature::Name::FUNDAMENTAL},
141+
{"hexagon_target_feature", Feature::Name::HEXAGON_TARGET_FEATURE},
142+
{"int_error_matching", Feature::Name::INT_ERROR_MATCHING},
143+
{"link_llvm_intrinsics", Feature::Name::LINK_LLVM_INTRINSICS},
144+
{"llvm_asm", Feature::Name::LLVM_ASM},
145+
{"mips_target_feature", Feature::Name::MIPS_TARGET_FEATURE},
146+
{"never_type", Feature::Name::NEVER_TYPE},
147+
{"nll", Feature::Name::NLL},
148+
{"no_niche", Feature::Name::NO_NICHE},
149+
{"or_patterns", Feature::Name::OR_PATTERNS},
150+
{"platform_intrinsics", Feature::Name::PLATFORM_INTRINSICS},
151+
{"powerpc_target_feature", Feature::Name::POWERPC_TARGET_FEATURE},
152+
{"repr_simd", Feature::Name::REPR_SIMD},
153+
{"rtm_target_feature", Feature::Name::RTM_TARGET_FEATURE},
154+
{"simd_ffi", Feature::Name::SIMD_FFI},
155+
{"slice_ptr_get", Feature::Name::SLICE_PTR_GET},
156+
{"sse4a_target_feature", Feature::Name::SSE4A_TARGET_FEATURE},
157+
{"staged_api", Feature::Name::STAGED_API},
158+
{"std_internals", Feature::Name::STD_INTERNALS},
159+
{"stmt_expr_attributes", Feature::Name::STMT_EXPR_ATTRIBUTES},
160+
{"str_split_as_str", Feature::Name::STR_SPLIT_AS_STR},
161+
{"str_split_inclusive_as_str", Feature::Name::STR_SPLIT_INCLUSIVE_AS_STR},
162+
{"tbm_target_feature", Feature::Name::TBM_TARGET_FEATURE},
163+
{"transparent_unions", Feature::Name::TRANSPARENT_UNIONS},
164+
{"try_blocks", Feature::Name::TRY_BLOCKS},
165+
{"unboxed_closures", Feature::Name::UNBOXED_CLOSURES},
166+
{"unsafe_block_in_unsafe_fn", Feature::Name::UNSAFE_BLOCK_IN_UNSAFE_FN},
167+
{"unwind_attributes", Feature::Name::UNWIND_ATTRIBUTES},
168+
{"variant_count", Feature::Name::VARIANT_COUNT},
169+
{"wasm_target_feature", Feature::Name::WASM_TARGET_FEATURE},
87170
};
88171

89172
tl::optional<Feature::Name>

gcc/rust/checks/errors/rust-feature.h

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,88 @@ class Feature
5252
EXCLUSIVE_RANGE_PATTERN,
5353
PRELUDE_IMPORT,
5454
MIN_SPECIALIZATION,
55+
AARCH64_TARGET_FEATURE,
56+
ABI_UNADJUSTED,
57+
ADX_TARGET_FEATURE,
58+
ALLOW_INTERNAL_UNSTABLE,
59+
ARBITRARY_SELF_TYPES,
60+
ARM_TARGET_FEATURE,
61+
ASM,
62+
AVX512_TARGET_FEATURE,
63+
CFG_TARGET_HAS_ATOMIC,
64+
CMPXCHG16B_TARGET_FEATURE,
65+
CONST_ALIGN_OF_VAL,
66+
CONST_ALLOC_LAYOUT,
67+
CONST_CALLER_LOCATION,
68+
CONST_CELL_INTO_INNER,
69+
CONST_CHECKED_INT_METHODS,
70+
CONST_DISCRIMINANT,
71+
CONST_EUCLIDEAN_INT_METHODS,
72+
CONST_FLOAT_BITS_CONV,
73+
CONST_FLOAT_CLASSIFY,
74+
CONST_FN,
75+
CONST_FN_FLOATING_POINT_ARITHMETIC,
76+
CONST_FN_FN_PTR_BASICS,
77+
CONST_FN_TRANSMUTE,
78+
CONST_FN_UNION,
79+
CONST_GENERICS,
80+
CONST_INT_POW,
81+
CONST_INT_UNCHECKED_ARITH,
82+
CONST_LIKELY,
83+
CONST_MUT_REFS,
84+
CONST_OPTION,
85+
CONST_OVERFLOWING_INT_METHODS,
86+
CONST_PANIC,
87+
CONST_PIN,
88+
CONST_PRECISE_LIVE_DROPS,
89+
CONST_PTR_OFFSET,
90+
CONST_PTR_OFFSET_FROM,
91+
CONST_RAW_PTR_COMPARISON,
92+
CONST_SIZE_OF_VAL,
93+
CONST_SLICE_FROM_RAW_PARTS,
94+
CONST_SLICE_PTR_LEN,
95+
CONST_TYPE_ID,
96+
CONST_TYPE_NAME,
97+
CONST_UNREACHABLE_UNCHECKED,
98+
CONSTCTLZ,
99+
CUSTOM_INNER_ATTRIBUTES,
100+
DOC_CFG,
101+
DOC_SPOTLIGHT,
102+
DURATION_CONSTS_2,
103+
DURATION_SATURATING_OPS,
104+
EXHAUSTIVE_PATTERNS,
105+
EXTERNAL_DOC,
106+
F16C_TARGET_FEATURE,
107+
FUNDAMENTAL,
108+
HEXAGON_TARGET_FEATURE,
109+
INT_ERROR_MATCHING,
110+
LINK_LLVM_INTRINSICS,
111+
LLVM_ASM,
112+
MIPS_TARGET_FEATURE,
113+
NEVER_TYPE,
114+
NLL,
115+
NO_NICHE,
116+
OR_PATTERNS,
117+
PLATFORM_INTRINSICS,
118+
POWERPC_TARGET_FEATURE,
119+
REPR_SIMD,
120+
RTM_TARGET_FEATURE,
121+
SIMD_FFI,
122+
SLICE_PTR_GET,
123+
SSE4A_TARGET_FEATURE,
124+
STAGED_API,
125+
STD_INTERNALS,
126+
STMT_EXPR_ATTRIBUTES,
127+
STR_SPLIT_AS_STR,
128+
STR_SPLIT_INCLUSIVE_AS_STR,
129+
TBM_TARGET_FEATURE,
130+
TRANSPARENT_UNIONS,
131+
TRY_BLOCKS,
132+
UNBOXED_CLOSURES,
133+
UNSAFE_BLOCK_IN_UNSAFE_FN,
134+
UNWIND_ATTRIBUTES,
135+
VARIANT_COUNT,
136+
WASM_TARGET_FEATURE,
55137
};
56138

57139
const std::string &as_string () { return m_name_str; }

0 commit comments

Comments
 (0)