File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
compiler/rustc_hir_analysis/src/hir_ty_lowering Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2109,7 +2109,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
21092109 ) ;
21102110 self . lower_const_param ( def_id, hir_id)
21112111 }
2112- Res :: Def ( DefKind :: Const | DefKind :: Ctor ( _, CtorKind :: Const ) , did) => {
2112+ Res :: Def (
2113+ DefKind :: Const | DefKind :: Static { .. } | DefKind :: Ctor ( _, CtorKind :: Const ) ,
2114+ did,
2115+ ) => {
21132116 assert_eq ! ( opt_self_ty, None ) ;
21142117 let _ = self . prohibit_generic_args (
21152118 path. segments . split_last ( ) . unwrap ( ) . 1 . iter ( ) ,
@@ -2132,7 +2135,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
21322135 // an invalid Res for a const path.
21332136 Res :: Def (
21342137 DefKind :: Mod
2135- | DefKind :: Static { .. }
21362138 | DefKind :: Enum
21372139 | DefKind :: Variant
21382140 | DefKind :: Ctor ( CtorOf :: Variant , CtorKind :: Fn )
Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ pub static STATIC : u32 = 0 ;
4+ pub struct Foo < const N : u32 > ;
5+ pub const FOO : Foo < { STATIC } > = Foo ;
6+
7+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments