File tree 3 files changed +8
-5
lines changed
hir-def/src/macro_expansion_tests
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ struct#10 MyTraitMap2#32 {#13
48
48
49
49
#[ test]
50
50
fn token_mapping_floats ( ) {
51
+ // Regression test for https://github.com/rust-lang/rust-analyzer/issues/12216
52
+ // (and related issues)
51
53
check (
52
54
r#"
53
55
// +tokenids
@@ -87,9 +89,9 @@ macro_rules! f {#0
87
89
// }
88
90
fn#19 main#20(#21)#21 {#22
89
91
1#23;#24
90
- 1#26.0;
91
- let x#31 =#22 1;
92
- }
92
+ 1.0#25;#26
93
+ let#27 x#28 =#29 1#30;#31
94
+ }#22
93
95
94
96
95
97
"## ] ] ,
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ macro_rules! id {
104
104
$($t)*
105
105
};
106
106
}
107
- id! {
107
+ id /*+errors*/ ! {
108
108
#[proc_macros::identity]
109
109
impl Foo for WrapBj {
110
110
async fn foo(&self) {
@@ -119,6 +119,7 @@ macro_rules! id {
119
119
$($t)*
120
120
};
121
121
}
122
+ /* parse error: expected SEMICOLON */
122
123
#[proc_macros::identity] impl Foo for WrapBj {
123
124
async fn foo(&self ) {
124
125
self .0.id().await ;
Original file line number Diff line number Diff line change @@ -1062,7 +1062,7 @@ impl<'a> CompletionContext<'a> {
1062
1062
let receiver_is_ambiguous_float_literal = match & receiver {
1063
1063
Some ( ast:: Expr :: Literal ( l) ) => matches! {
1064
1064
l. kind( ) ,
1065
- ast:: LiteralKind :: FloatNumber { .. } if l. syntax( ) . last_token( ) . map_or( false , |it| it. kind ( ) == T ! [ . ] )
1065
+ ast:: LiteralKind :: FloatNumber { .. } if l. syntax( ) . last_token( ) . map_or( false , |it| it. text ( ) . ends_with ( '.' ) )
1066
1066
} ,
1067
1067
_ => false ,
1068
1068
} ;
You can’t perform that action at this time.
0 commit comments