File tree 4 files changed +21
-2
lines changed
4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,9 @@ impl Spanned for ast::Param {
117
117
118
118
impl Spanned for ast:: GenericParam {
119
119
fn span ( & self ) -> Span {
120
- let lo = if self . attrs . is_empty ( ) {
120
+ let lo = if let ast:: GenericParamKind :: Const { ty : _, kw_span } = self . kind {
121
+ kw_span. lo ( )
122
+ } else if self . attrs . is_empty ( ) {
121
123
self . ident . span . lo ( )
122
124
} else {
123
125
self . attrs [ 0 ] . span . lo ( )
Original file line number Diff line number Diff line change @@ -559,7 +559,7 @@ impl Rewrite for ast::GenericParam {
559
559
_ => { }
560
560
}
561
561
562
- if let rustc_ast :: ast:: GenericParamKind :: Const { ref ty } = & self . kind {
562
+ if let ast:: GenericParamKind :: Const { ref ty, kw_span : _ } = & self . kind {
563
563
result. push_str ( "const " ) ;
564
564
result. push_str ( rewrite_ident ( context, self . ident ) ) ;
565
565
result. push_str ( ": " ) ;
Original file line number Diff line number Diff line change @@ -34,3 +34,11 @@ type Foo<const N: usize> = [i32; N + 1];
34
34
pub trait Foo : Bar < { Baz :: COUNT } > {
35
35
const ASD : usize ;
36
36
}
37
+
38
+ // #4263
39
+ fn const_generics_on_params <
40
+ // AAAA
41
+ const BBBB : usize ,
42
+ /* CCCC */
43
+ const DDDD : usize ,
44
+ > ( ) { }
Original file line number Diff line number Diff line change @@ -26,3 +26,12 @@ type Foo<const N: usize> = [i32; N + 1];
26
26
pub trait Foo : Bar < { Baz :: COUNT } > {
27
27
const ASD : usize ;
28
28
}
29
+
30
+ // #4263
31
+ fn const_generics_on_params <
32
+ // AAAA
33
+ const BBBB : usize ,
34
+ /* CCCC */
35
+ const DDDD : usize ,
36
+ > ( ) {
37
+ }
You can’t perform that action at this time.
0 commit comments