Skip to content

Commit 125afc1

Browse files
committed
Revert "Fix regression: the feature is not needed"
This reverts commit 675ad69.
1 parent 675ad69 commit 125afc1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
819819
let span = tcx.def_span(param.def_id);
820820
let def_id = param.def_id.expect_local();
821821

822-
if tcx.features().adt_const_params()
823-
|| tcx.features().enabled(sym::unsized_const_params)
824-
{
822+
if tcx.features().adt_const_params() {
825823
enter_wf_checking_ctxt(tcx, tcx.local_parent(def_id), |wfcx| {
826824
wfcx.register_bound(
827825
ObligationCause::new(span, def_id, ObligationCauseCode::ConstParam(ty)),

tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ help: you might be missing a const parameter
99
LL | impl<const bar: /* Type */> Wrapper<{ bar() }> {
1010
| +++++++++++++++++++++++
1111

12-
error[E0741]: using function pointers as const generic parameters is forbidden
12+
error: using function pointers as const generic parameters is forbidden
1313
--> $DIR/non_valtreeable_const_arg-2.rs:8:25
1414
|
1515
LL | struct Wrapper<const F: fn()>;
1616
| ^^^^
17+
|
18+
= note: the only supported types are integers, `bool`, and `char`
1719

1820
error[E0599]: the function or associated item `call` exists for struct `Wrapper<function>`, but its trait bounds were not satisfied
1921
--> $DIR/non_valtreeable_const_arg-2.rs:17:26
@@ -35,5 +37,5 @@ note: the trait `Fn` must be implemented
3537

3638
error: aborting due to 3 previous errors
3739

38-
Some errors have detailed explanations: E0425, E0599, E0741.
40+
Some errors have detailed explanations: E0425, E0599.
3941
For more information about an error, try `rustc --explain E0425`.

tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-pass
22
//@ compile-flags: -Csymbol-mangling-version=v0
33
#![allow(incomplete_features)]
4-
#![feature(unsized_const_params)]
4+
#![feature(adt_const_params, unsized_const_params)]
55

66
// Regression test for #116303
77

0 commit comments

Comments
 (0)