Skip to content

Commit 2e5a025

Browse files
authored
Rollup merge of rust-lang#56908 - alexcrichton:new-features, r=oli-obk
rustc: Don't ICE on usage of two new target features I seem to always forget to update this portion of the compiler...
2 parents 39dc2c4 + a0b766d commit 2e5a025

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
@@ -417,6 +417,8 @@ declare_features! (
417417
(active, sse4a_target_feature, "1.27.0", Some(44839), None),
418418
(active, tbm_target_feature, "1.27.0", Some(44839), None),
419419
(active, wasm_target_feature, "1.30.0", Some(44839), None),
420+
(active, adx_target_feature, "1.32.0", Some(44839), None),
421+
(active, cmpxchg16b_target_feature, "1.32.0", Some(44839), None),
420422

421423
// Allows macro invocations on modules expressions and statements and
422424
// 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)