Skip to content

Commit 87e7817

Browse files
committed
feature(const_param_types) -> feature(adt_const_params)
1 parent 4747cbb commit 87e7817

File tree

77 files changed

+108
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+108
-108
lines changed

compiler/rustc_error_codes/src/error_codes/E0741.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ A non-structural-match type was used as the type of a const generic parameter.
33
Erroneous code example:
44

55
```compile_fail,E0741
6-
#![feature(const_param_types)]
6+
#![feature(adt_const_params)]
77
88
struct A;
99
@@ -16,7 +16,7 @@ may be used as the types of const generic parameters.
1616
To fix the previous code example, we derive `PartialEq` and `Eq`:
1717

1818
```
19-
#![feature(const_param_types)]
19+
#![feature(adt_const_params)]
2020
2121
#[derive(PartialEq, Eq)] // We derive both traits here.
2222
struct A;

compiler/rustc_error_codes/src/error_codes/E0771.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ allowed.
44
Erroneous code example:
55

66
```compile_fail,E0771
7-
#![feature(const_param_types)]
7+
#![feature(adt_const_params)]
88
99
fn function_with_str<'a, const STRING: &'a str>() {} // error!
1010
```
@@ -13,7 +13,7 @@ To fix this issue, the lifetime in the const generic need to be changed to
1313
`'static`:
1414

1515
```
16-
#![feature(const_param_types)]
16+
#![feature(adt_const_params)]
1717
1818
fn function_with_str<const STRING: &'static str>() {} // ok!
1919
```

compiler/rustc_feature/src/active.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ macro_rules! declare_features {
7171
}
7272

7373
pub fn unordered_const_ty_params(&self) -> bool {
74-
self.const_generics_defaults || self.generic_const_exprs || self.const_param_types
74+
self.const_generics_defaults || self.generic_const_exprs || self.adt_const_params
7575
}
7676

7777
/// Some features are known to be incomplete and using them is likely to have
@@ -674,7 +674,7 @@ declare_features! (
674674
(incomplete, generic_const_exprs, "1.56.0", Some(76560), None),
675675

676676
/// Allows additional const parameter types, such as `&'static str` or user defined types
677-
(incomplete, const_param_types, "1.56.0", Some(44580), None),
677+
(incomplete, adt_const_params, "1.56.0", Some(44580), None),
678678

679679
// -------------------------------------------------------------------------
680680
// feature-group-end: actual feature gates

compiler/rustc_feature/src/removed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ declare_features! (
104104
(removed, quote, "1.33.0", Some(29601), None, None),
105105
/// Allows const generic types (e.g. `struct Foo<const N: usize>(...);`).
106106
(removed, const_generics, "1.34.0", Some(44580), None,
107-
Some("removed in favor of `#![feature(const_param_types]` and `#![feature(generic_const_exprs)]`")),
107+
Some("removed in favor of `#![feature(adt_const_params]` and `#![feature(generic_const_exprs)]`")),
108108
/// Allows `[x; N]` where `x` is a constant (RFC 2203).
109109
(removed, const_in_array_repeat_expressions, "1.37.0", Some(49147), None,
110110
Some("removed due to causing promotable bugs")),

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ symbols! {
284284
add_assign,
285285
add_with_overflow,
286286
address,
287+
adt_const_params,
287288
advanced_slice_patterns,
288289
adx_target_feature,
289290
alias,
@@ -451,7 +452,6 @@ symbols! {
451452
const_mut_refs,
452453
const_panic,
453454
const_panic_fmt,
454-
const_param_types,
455455
const_precise_live_drops,
456456
const_ptr,
457457
const_raw_ptr_deref,

compiler/rustc_typeck/src/check/wfcheck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) {
290290

291291
let err_ty_str;
292292
let mut is_ptr = true;
293-
let err = if tcx.features().const_param_types {
293+
let err = if tcx.features().adt_const_params {
294294
match ty.peel_refs().kind() {
295295
ty::FnPtr(_) => Some("function pointers"),
296296
ty::RawPtr(_) => Some("raw pointers"),
@@ -328,7 +328,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) {
328328
err.note("the only supported types are integers, `bool` and `char`");
329329
if tcx.sess.is_nightly_build() {
330330
err.help(
331-
"more complex types are supported with `#![feature(const_param_types)]`",
331+
"more complex types are supported with `#![feature(adt_const_params)]`",
332332
);
333333
}
334334
err.emit()

src/test/debuginfo/function-names.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
#![allow(unused_variables)]
8383
#![feature(omit_gdb_pretty_printer_section)]
8484
#![omit_gdb_pretty_printer_section]
85-
#![feature(const_param_types, generators, generator_trait)]
85+
#![feature(adt_const_params, generators, generator_trait)]
8686
#![allow(incomplete_features)]
8787

8888
use Mod1::TestTrait2;

src/test/incremental/const-generics/hash-tyvid-regression-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions: cfail
2-
#![feature(generic_const_exprs, const_param_types)]
2+
#![feature(generic_const_exprs, adt_const_params)]
33
#![allow(incomplete_features)]
44
// regression test for #77650
55
fn c<T, const N: std::num::NonZeroUsize>()

src/test/incremental/const-generics/hash-tyvid-regression-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions: cfail
2-
#![feature(generic_const_exprs, const_param_types, const_generics_defaults)]
2+
#![feature(generic_const_exprs, adt_const_params, const_generics_defaults)]
33
#![allow(incomplete_features)]
44
// regression test for #77650
55
struct C<T, const N: core::num::NonZeroUsize>([T; N.get()])

src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions: rpass
2-
#![feature(generic_const_exprs, const_param_types)]
2+
#![feature(generic_const_exprs, adt_const_params)]
33
#![allow(incomplete_features)]
44

55
use std::{convert::TryFrom, num::NonZeroUsize};

src/test/rustdoc/const-generics/const-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_param_types)]
1+
#![feature(adt_const_params)]
22

33
#![crate_name = "foo"]
44

src/test/ui/async-await/issues/issue-78654.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// edition:2018
22
// revisions: full min
33

4-
#![cfg_attr(full, feature(const_param_types))]
4+
#![cfg_attr(full, feature(adt_const_params))]
55
#![cfg_attr(full, allow(incomplete_features))]
66

77
struct Foo;

src/test/ui/const-generics/const-param-elided-lifetime.min.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ LL | struct A<const N: &u8>;
3535
| ^^^
3636
|
3737
= note: the only supported types are integers, `bool` and `char`
38-
= help: more complex types are supported with `#![feature(const_param_types)]`
38+
= help: more complex types are supported with `#![feature(adt_const_params)]`
3939

4040
error: `&'static u8` is forbidden as the type of a const generic parameter
4141
--> $DIR/const-param-elided-lifetime.rs:14:15
@@ -44,7 +44,7 @@ LL | impl<const N: &u8> A<N> {
4444
| ^^^
4545
|
4646
= note: the only supported types are integers, `bool` and `char`
47-
= help: more complex types are supported with `#![feature(const_param_types)]`
47+
= help: more complex types are supported with `#![feature(adt_const_params)]`
4848

4949
error: `&'static u8` is forbidden as the type of a const generic parameter
5050
--> $DIR/const-param-elided-lifetime.rs:17:21
@@ -53,7 +53,7 @@ LL | fn foo<const M: &u8>(&self) {}
5353
| ^^^
5454
|
5555
= note: the only supported types are integers, `bool` and `char`
56-
= help: more complex types are supported with `#![feature(const_param_types)]`
56+
= help: more complex types are supported with `#![feature(adt_const_params)]`
5757

5858
error: `&'static u8` is forbidden as the type of a const generic parameter
5959
--> $DIR/const-param-elided-lifetime.rs:22:15
@@ -62,7 +62,7 @@ LL | impl<const N: &u8> B for A<N> {}
6262
| ^^^
6363
|
6464
= note: the only supported types are integers, `bool` and `char`
65-
= help: more complex types are supported with `#![feature(const_param_types)]`
65+
= help: more complex types are supported with `#![feature(adt_const_params)]`
6666

6767
error: `&'static u8` is forbidden as the type of a const generic parameter
6868
--> $DIR/const-param-elided-lifetime.rs:26:17
@@ -71,7 +71,7 @@ LL | fn bar<const N: &u8>() {}
7171
| ^^^
7272
|
7373
= note: the only supported types are integers, `bool` and `char`
74-
= help: more complex types are supported with `#![feature(const_param_types)]`
74+
= help: more complex types are supported with `#![feature(adt_const_params)]`
7575

7676
error: aborting due to 10 previous errors
7777

src/test/ui/const-generics/const-param-elided-lifetime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// elided lifetimes within the type of a const generic parameters to be 'static, like elided
44
// lifetimes within const/static items.
55
// revisions: full min
6-
#![cfg_attr(full, feature(const_param_types))]
6+
#![cfg_attr(full, feature(adt_const_params))]
77
#![cfg_attr(full, allow(incomplete_features))]
88

99
struct A<const N: &u8>;

src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
1717
| ^^^^^^^
1818
|
1919
= note: the only supported types are integers, `bool` and `char`
20-
= help: more complex types are supported with `#![feature(const_param_types)]`
20+
= help: more complex types are supported with `#![feature(adt_const_params)]`
2121

2222
error: `[u8; _]` is forbidden as the type of a const generic parameter
2323
--> $DIR/const-param-type-depends-on-const-param.rs:15:35
@@ -26,7 +26,7 @@ LL | pub struct SelfDependent<const N: [u8; N]>;
2626
| ^^^^^^^
2727
|
2828
= note: the only supported types are integers, `bool` and `char`
29-
= help: more complex types are supported with `#![feature(const_param_types)]`
29+
= help: more complex types are supported with `#![feature(adt_const_params)]`
3030

3131
error: aborting due to 4 previous errors
3232

src/test/ui/const-generics/const-param-type-depends-on-const-param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// revisions: full min
22

3-
#![cfg_attr(full, feature(const_param_types))]
3+
#![cfg_attr(full, feature(adt_const_params))]
44
#![cfg_attr(full, allow(incomplete_features))]
55

66
// Currently, const parameters cannot depend on other generic parameters,

src/test/ui/const-generics/const-param-type-depends-on-type-param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// revisions: full min
22

3-
#![cfg_attr(full, feature(const_param_types))]
3+
#![cfg_attr(full, feature(adt_const_params))]
44
#![cfg_attr(full, allow(incomplete_features))]
55

66
// Currently, const parameters cannot depend on other generic parameters,

src/test/ui/const-generics/core-types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// run-pass
33
// revisions: full min
44

5-
#![cfg_attr(full, feature(const_param_types))]
5+
#![cfg_attr(full, feature(adt_const_params))]
66
#![cfg_attr(full, allow(incomplete_features))]
77

88
struct A<const N: u8>;

src/test/ui/const-generics/different_generic_args_array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Check that different const types are different.
2-
#![feature(const_param_types)]
2+
#![feature(adt_const_params)]
33
#![allow(incomplete_features)]
44

55
struct Const<const V: [usize; 1]> {}

src/test/ui/const-generics/fn-const-param-call.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Check that functions cannot be used as const parameters.
22
// revisions: full min
33

4-
#![cfg_attr(full, feature(const_param_types))]
4+
#![cfg_attr(full, feature(adt_const_params))]
55
#![cfg_attr(full, allow(incomplete_features))]
66

77
fn function() -> u32 {

src/test/ui/const-generics/fn-const-param-infer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// revisions: full min
22

3-
#![cfg_attr(full, feature(const_param_types))]
3+
#![cfg_attr(full, feature(adt_const_params))]
44
#![cfg_attr(full, allow(incomplete_features))]
55

66
struct Checked<const F: fn(usize) -> bool>;

src/test/ui/const-generics/forbid-non-structural_match-types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_param_types)]
1+
#![feature(adt_const_params)]
22
#![allow(incomplete_features)]
33

44
#[derive(PartialEq, Eq)]

src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | struct B<const CFG: Config> {
2323
| ^^^^^^
2424
|
2525
= note: the only supported types are integers, `bool` and `char`
26-
= help: more complex types are supported with `#![feature(const_param_types)]`
26+
= help: more complex types are supported with `#![feature(adt_const_params)]`
2727

2828
error: aborting due to 3 previous errors
2929

src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Tests that array sizes that depend on const-params are checked using `ConstEvaluatable`.
22
// revisions: full min
33

4-
#![cfg_attr(full, feature(generic_const_exprs, const_param_types))]
4+
#![cfg_attr(full, feature(generic_const_exprs, adt_const_params))]
55
#![cfg_attr(full, allow(incomplete_features))]
66

77
#[allow(dead_code)]

src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | trait Trait<const S: &'static str> {}
1414
| ^^^^^^^^^^^^
1515
|
1616
= note: the only supported types are integers, `bool` and `char`
17-
= help: more complex types are supported with `#![feature(const_param_types)]`
17+
= help: more complex types are supported with `#![feature(adt_const_params)]`
1818

1919
error: aborting due to 2 previous errors
2020

src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// revisions: full min
33

44
#![cfg_attr(full, allow(incomplete_features))]
5-
#![cfg_attr(full, feature(const_param_types, generic_const_exprs))]
5+
#![cfg_attr(full, feature(adt_const_params, generic_const_exprs))]
66

77
#![feature(core_intrinsics)]
88
#![feature(const_type_name)]

src/test/ui/const-generics/invalid-enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_param_types, const_generics_defaults)]
1+
#![feature(adt_const_params, const_generics_defaults)]
22
#![allow(incomplete_features)]
33

44
#[derive(PartialEq, Eq)]

src/test/ui/const-generics/issues/issue-56445-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-518402995.
22
// revisions: full min
3-
#![cfg_attr(full, feature(const_param_types))]
3+
#![cfg_attr(full, feature(adt_const_params))]
44
#![cfg_attr(full, allow(incomplete_features))]
55
#![crate_type = "lib"]
66

src/test/ui/const-generics/issues/issue-62878.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | fn foo<const N: usize, const A: [u8; N]>() {}
1111
| ^^^^^^^
1212
|
1313
= note: the only supported types are integers, `bool` and `char`
14-
= help: more complex types are supported with `#![feature(const_param_types)]`
14+
= help: more complex types are supported with `#![feature(adt_const_params)]`
1515

1616
error: aborting due to 2 previous errors
1717

src/test/ui/const-generics/issues/issue-62878.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions: full min
2-
#![cfg_attr(full, feature(const_param_types, generic_arg_infer))]
2+
#![cfg_attr(full, feature(adt_const_params, generic_arg_infer))]
33
#![cfg_attr(full, allow(incomplete_features))]
44

55
fn foo<const N: usize, const A: [u8; N]>() {}

src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn test<const T: &'static dyn A>() {
55
| ^^^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#![feature(const_param_types)]`
8+
= help: more complex types are supported with `#![feature(adt_const_params)]`
99

1010
error[E0741]: `&'static (dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
1111
--> $DIR/issue-63322-forbid-dyn.rs:9:18

src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions: full min
2-
#![cfg_attr(full, feature(const_param_types))]
2+
#![cfg_attr(full, feature(adt_const_params))]
33
#![cfg_attr(full, allow(incomplete_features))]
44

55
trait A {}

src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
#![feature(const_param_types)]
2+
#![feature(adt_const_params)]
33
#![allow(incomplete_features)]
44

55

src/test/ui/const-generics/issues/issue-68615-adt.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Const<const V: [usize; 0]> {}
55
| ^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#![feature(const_param_types)]`
8+
= help: more complex types are supported with `#![feature(adt_const_params)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/issues/issue-68615-adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// [full] check-pass
22
// revisions: full min
3-
#![cfg_attr(full, feature(const_param_types))]
3+
#![cfg_attr(full, feature(adt_const_params))]
44
#![cfg_attr(full, allow(incomplete_features))]
55

66
struct Const<const V: [usize; 0]> {}

src/test/ui/const-generics/issues/issue-68615-array.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Foo<const V: [usize; 0] > {}
55
| ^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#![feature(const_param_types)]`
8+
= help: more complex types are supported with `#![feature(adt_const_params)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/issues/issue-68615-array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// [full] check-pass
22
// revisions: full min
3-
#![cfg_attr(full, feature(const_param_types))]
3+
#![cfg_attr(full, feature(adt_const_params))]
44
#![cfg_attr(full, allow(incomplete_features))]
55

66
struct Foo<const V: [usize; 0] > {}

0 commit comments

Comments
 (0)