Skip to content

Commit 675ad69

Browse files
committed
Fix regression: the feature is not needed
1 parent f23ad2d commit 675ad69

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ 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() {
822+
if tcx.features().adt_const_params()
823+
|| tcx.features().enabled(sym::unsized_const_params)
824+
{
823825
enter_wf_checking_ctxt(tcx, tcx.local_parent(def_id), |wfcx| {
824826
wfcx.register_bound(
825827
ObligationCause::new(span, def_id, ObligationCauseCode::ConstParam(ty)),

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

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

12-
error: using function pointers as const generic parameters is forbidden
12+
error[E0741]: 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`
1917

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

3836
error: aborting due to 3 previous errors
3937

40-
Some errors have detailed explanations: E0425, E0599.
38+
Some errors have detailed explanations: E0425, E0599, E0741.
4139
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(adt_const_params, unsized_const_params)]
4+
#![feature(unsized_const_params)]
55

66
// Regression test for #116303
77

0 commit comments

Comments
 (0)