Skip to content

Commit fae3918

Browse files
committed
allow anon consts with expected types with generics
1 parent e3f9fa3 commit fae3918

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_hir_analysis/src/hir_ty_lowering

1 file changed

+3
-1
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,7 +2223,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
22232223
}
22242224
// We error when the type contains unsubstituted generics since we do not currently
22252225
// give the anon const any of the generics from the parent.
2226-
if anon_const_type.has_non_region_param() {
2226+
if tcx.features().generic_const_parameter_types()
2227+
&& anon_const_type.has_non_region_param()
2228+
{
22272229
let e = self.dcx().span_err(
22282230
const_arg.span(),
22292231
"anonymous constants referencing generics are not yet supported",

0 commit comments

Comments
 (0)