File tree 5 files changed +65
-1
lines changed
5 files changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -2418,7 +2418,7 @@ fn rewrite_fn_base(
2418
2418
result. push_str ( & ret_str) ;
2419
2419
}
2420
2420
2421
- // Clusure to handle a comment in a snippet
2421
+ // Closure to handle a comment in a snippet
2422
2422
let mut snippet_comment_handling = |span_lo, span_hi, consider_force_new_line_for_brace| {
2423
2423
let snippet = context. snippet ( mk_sp ( span_lo, span_hi) ) ;
2424
2424
// Try to preserve the layout of the original snippet.
Original file line number Diff line number Diff line change @@ -15,6 +15,23 @@ String::new()
15
15
}
16
16
}
17
17
18
+ // Original from #4649
19
+ trait Foo {
20
+ fn bar ( & self )
21
+ where
22
+ // Self: Bar
23
+ // Some comment
24
+ ;
25
+ }
26
+
27
+ fn foo < T > ( )
28
+ where
29
+ // T: Bar,
30
+ // Some comment
31
+ {
32
+ println ! ( "foo" ) ;
33
+ }
34
+
18
35
// Return-type with no "where" - one comment
19
36
fn main ( ) {
20
37
fn foo1 ( ) -> String /* same-line with ret-type and brace comment */ {
Original file line number Diff line number Diff line change @@ -15,6 +15,23 @@ String::new()
15
15
}
16
16
}
17
17
18
+ // Original from #4649
19
+ trait Foo {
20
+ fn bar ( & self )
21
+ where
22
+ // Self: Bar
23
+ // Some comment
24
+ ;
25
+ }
26
+
27
+ fn foo < T > ( )
28
+ where
29
+ // T: Bar,
30
+ // Some comment
31
+ {
32
+ println ! ( "foo" ) ;
33
+ }
34
+
18
35
// Return-type with no "where" - one comment
19
36
fn main ( ) {
20
37
fn foo1 ( ) -> String /* same-line with ret-type and brace comment */ {
Original file line number Diff line number Diff line change @@ -13,6 +13,21 @@ mod inner {
13
13
}
14
14
}
15
15
16
+ // Original from #4649
17
+ trait Foo {
18
+ fn bar ( & self )
19
+ // Self: Bar
20
+ // Some comment
21
+ ;
22
+ }
23
+
24
+ fn foo < T > ( )
25
+ // T: Bar,
26
+ // Some comment
27
+ {
28
+ println ! ( "foo" ) ;
29
+ }
30
+
16
31
// Return-type with no "where" - one comment
17
32
fn main ( ) {
18
33
fn foo1 ( ) -> String /* same-line with ret-type and brace comment */ { }
Original file line number Diff line number Diff line change @@ -13,6 +13,21 @@ mod inner {
13
13
}
14
14
}
15
15
16
+ // Original from #4649
17
+ trait Foo {
18
+ fn bar ( & self )
19
+ // Self: Bar
20
+ // Some comment
21
+ ;
22
+ }
23
+
24
+ fn foo < T > ( )
25
+ // T: Bar,
26
+ // Some comment
27
+ {
28
+ println ! ( "foo" ) ;
29
+ }
30
+
16
31
// Return-type with no "where" - one comment
17
32
fn main ( ) {
18
33
fn foo1 ( ) -> String /* same-line with ret-type and brace comment */ { }
You can’t perform that action at this time.
0 commit comments