about summary refs log tree commit diff
path: root/src/test/ui/array-slice-vec
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-08-30 22:21:01 +0000
committerbors <bors@rust-lang.org>2021-08-30 22:21:01 +0000
commit6f388bb369ddb6fb64e547009e031598425f773c (patch)
treea8be664d361c23e350e4f7029c46cfd94e4bf96a /src/test/ui/array-slice-vec
parent5d6804469d80aaf26f98090ae016af45e267f58f (diff)
parent87e781799a160129169b838e900aaef8ecb3a9dd (diff)
downloadrust-6f388bb369ddb6fb64e547009e031598425f773c.tar.gz
rust-6f388bb369ddb6fb64e547009e031598425f773c.zip
Auto merge of #88369 - lcnr:cec-rename, r=oli-obk
update const generics feature gates

**tl;dr: split const generics into three features: `adt_const_params`, `const_generics_defaults` and `generic_const_exprs`**

continuing the work of `@BoxyUwU` in #88324, this PR
- renames `feature(const_evaluatable_checked)` to `feature(generic_const_exprs)` which now doesn't need any other feature gate to work. Previously `feature(const_evaluatable_checked)` was only useful in combination with `feature(const_generics)`.
- completely removes `feature(lazy_normalization_consts)`. This feature only supplied the parents generics to anonymous constants, which is pretty useless as generic anon consts are only allowed with `feature(generic_const_exprs)` anyways.
- moves the ability to use additional const param types from `feature(const_generics)` into `feature(adt_const_params)`. As `feature(const_generics)` is now mostly useless without `feature(generic_const_exprs)` we also remove that feature flag.
- updates tests, removing duplicates and unnecessary revisions in some cases and also deletes all unused `*.stderr` files.

I not also remove the ordering restriction for const and type parameters if any of the three const generics features is active.
This ordering restriction feels like the only "real" use of the current `feature(const_generics)` right now so this change isn't a perfect solution, but as I intend to stabilize the ordering - and `feature(const_generics_defaults)` -  in the very near future, I think this is acceptable for now.

---

cc `@rust-lang/project-const-generics` about the new feature names and this change in general.

I don't think we need any external approval for this change but I do intend to publish an update to the const generics tracking issue the day this PR lands, so I don't want this merged yet.

Apologies to whoever ends up reviewing this PR :sweat_smile: :heart:

r? rust-lang/project-const-generics
Diffstat (limited to 'src/test/ui/array-slice-vec')
-rw-r--r--src/test/ui/array-slice-vec/match_arr_unknown_len.rs3
-rw-r--r--src/test/ui/array-slice-vec/match_arr_unknown_len.stderr13
2 files changed, 2 insertions, 14 deletions
diff --git a/src/test/ui/array-slice-vec/match_arr_unknown_len.rs b/src/test/ui/array-slice-vec/match_arr_unknown_len.rs
index 45b2889f1ca..d190d7054fe 100644
--- a/src/test/ui/array-slice-vec/match_arr_unknown_len.rs
+++ b/src/test/ui/array-slice-vec/match_arr_unknown_len.rs
@@ -1,6 +1,3 @@
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete
-
 fn is_123<const N: usize>(x: [u32; N]) -> bool {
     match x {
         [1, 2] => true, //~ ERROR mismatched types
diff --git a/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr b/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr
index 0ad05b3adeb..1a14ab40b1f 100644
--- a/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr
+++ b/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr
@@ -1,14 +1,5 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/match_arr_unknown_len.rs:1:12
-   |
-LL | #![feature(const_generics)]
-   |            ^^^^^^^^^^^^^^
-   |
-   = note: `#[warn(incomplete_features)]` on by default
-   = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
 error[E0308]: mismatched types
-  --> $DIR/match_arr_unknown_len.rs:6:9
+  --> $DIR/match_arr_unknown_len.rs:3:9
    |
 LL |         [1, 2] => true,
    |         ^^^^^^ expected `2_usize`, found `N`
@@ -16,6 +7,6 @@ LL |         [1, 2] => true,
    = note: expected array `[u32; 2]`
               found array `[u32; N]`
 
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0308`.