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> + '_ {
2109
2109
) ;
2110
2110
self . lower_const_param ( def_id, hir_id)
2111
2111
}
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
+ ) => {
2113
2116
assert_eq ! ( opt_self_ty, None ) ;
2114
2117
let _ = self . prohibit_generic_args (
2115
2118
path. segments . split_last ( ) . unwrap ( ) . 1 . iter ( ) ,
@@ -2132,7 +2135,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
2132
2135
// an invalid Res for a const path.
2133
2136
Res :: Def (
2134
2137
DefKind :: Mod
2135
- | DefKind :: Static { .. }
2136
2138
| DefKind :: Enum
2137
2139
| DefKind :: Variant
2138
2140
| 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