File tree 3 files changed +13
-2
lines changed
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -236,10 +236,10 @@ pub(crate) fn format_expr(
236
236
/* Retrieving the comments before and after cast */
237
237
let prefix_span = mk_sp (
238
238
subexpr. span . hi ( ) ,
239
- context. snippet_provider . span_before ( expr. span , "as" ) ,
239
+ context. snippet_provider . span_before_last ( expr. span , "as" ) - BytePos ( 1 ) ,
240
240
) ;
241
241
let suffix_span = mk_sp (
242
- context. snippet_provider . span_after ( expr. span , "as" ) ,
242
+ context. snippet_provider . span_after_last ( expr. span , "as" ) ,
243
243
ty. span . lo ( ) ,
244
244
) ;
245
245
let infix_prefix_comments = rewrite_missing_comment ( prefix_span, shape, context) ?;
Original file line number Diff line number Diff line change
1
+ fn main ( ) { let z = ( x as f64 / y as f64 ) . floor ( ) as usize ; }
2
+
3
+
4
+ fn main ( ) { let z = ( x /* x */ as /*y */ f64 / y /* z */ as /* a */ f64 ) . floor ( ) /* b */ as /* c */ usize ; }
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ let z = ( x as f64 / y as f64 ) . floor ( ) as usize ;
3
+ }
4
+
5
+ fn main ( ) {
6
+ let z = ( x /* x */ as /*y */ f64 / y /* z */ as /* a */ f64 ) . floor ( ) /* b */ as /* c */ usize ;
7
+ }
You can’t perform that action at this time.
0 commit comments