This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
hir-def/src/macro_expansion_tests Expand file tree Collapse file tree 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
4848
4949#[ test]
5050fn token_mapping_floats ( ) {
51+ // Regression test for https://github.com/rust-lang/rust-analyzer/issues/12216
52+ // (and related issues)
5153 check (
5254 r#"
5355// +tokenids
@@ -87,9 +89,9 @@ macro_rules! f {#0
8789// }
8890fn#19 main#20(#21)#21 {#22
8991 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
9395
9496
9597"## ] ] ,
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ macro_rules! id {
104104 $($t)*
105105 };
106106}
107- id! {
107+ id /*+errors*/ ! {
108108 #[proc_macros::identity]
109109 impl Foo for WrapBj {
110110 async fn foo(&self) {
@@ -119,6 +119,7 @@ macro_rules! id {
119119 $($t)*
120120 };
121121}
122+ /* parse error: expected SEMICOLON */
122123#[proc_macros::identity] impl Foo for WrapBj {
123124 async fn foo(&self ) {
124125 self .0.id().await ;
Original file line number Diff line number Diff line change @@ -1062,7 +1062,7 @@ impl<'a> CompletionContext<'a> {
10621062 let receiver_is_ambiguous_float_literal = match & receiver {
10631063 Some ( ast:: Expr :: Literal ( l) ) => matches! {
10641064 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 ( '.' ) )
10661066 } ,
10671067 _ => false ,
10681068 } ;
You can’t perform that action at this time.
0 commit comments