Skip to content

Commit a0b766d

Browse files
committed
rustc: Don't ICE on usage of two new target features
I seem to always forget to update this portion of the compiler...
1 parent 54f3cd6 commit a0b766d

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

src/librustc_typeck/collect.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,8 @@ fn from_target_feature(
22072207
Some("sse4a_target_feature") => rust_features.sse4a_target_feature,
22082208
Some("tbm_target_feature") => rust_features.tbm_target_feature,
22092209
Some("wasm_target_feature") => rust_features.wasm_target_feature,
2210+
Some("cmpxchg16b_target_feature") => rust_features.cmpxchg16b_target_feature,
2211+
Some("adx_target_feature") => rust_features.adx_target_feature,
22102212
Some(name) => bug!("unknown target feature gate {}", name),
22112213
None => true,
22122214
};

src/libsyntax/feature_gate.rs

+2
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ declare_features! (
420420
(active, sse4a_target_feature, "1.27.0", Some(44839), None),
421421
(active, tbm_target_feature, "1.27.0", Some(44839), None),
422422
(active, wasm_target_feature, "1.30.0", Some(44839), None),
423+
(active, adx_target_feature, "1.32.0", Some(44839), None),
424+
(active, cmpxchg16b_target_feature, "1.32.0", Some(44839), None),
423425

424426
// Allows macro invocations on modules expressions and statements and
425427
// procedural macros to expand to non-items.

src/test/ui/target-feature-gate.rs

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
// gate-test-mips_target_feature
2525
// gate-test-mmx_target_feature
2626
// gate-test-wasm_target_feature
27+
// gate-test-adx_target_feature
28+
// gate-test-cmpxchg16b_target_feature
29+
// min-llvm-version 6.0
2730

2831
#[target_feature(enable = "avx512bw")]
2932
//~^ ERROR: currently unstable

src/test/ui/target-feature-gate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: the target feature `avx512bw` is currently unstable (see issue #44839)
2-
--> $DIR/target-feature-gate.rs:28:18
2+
--> $DIR/target-feature-gate.rs:31:18
33
|
44
LL | #[target_feature(enable = "avx512bw")]
55
| ^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)