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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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};

0 commit comments

Comments
 (0)