@@ -8803,7 +8803,7 @@ fn test_hover_function_with_pat_param() {
88038803 ```
88048804
88058805 ```rust
8806- fn test_4(Point { x: x , y: y, }: Point)
8806+ fn test_4(Point { x, y }: Point)
88078807 ```
88088808 "# ] ] ,
88098809 ) ;
@@ -8851,7 +8851,7 @@ fn test_hover_function_with_pat_param() {
88518851 ```
88528852
88538853 ```rust
8854- fn test_7((x, Foo { a: a , b: b, }): (i32, Foo))
8854+ fn test_7((x, Foo { a, b }): (i32, Foo))
88558855 ```
88568856 "# ] ] ,
88578857 ) ;
@@ -8871,4 +8871,52 @@ fn test_hover_function_with_pat_param() {
88718871 ```
88728872 "# ] ] ,
88738873 ) ;
8874+
8875+ // Test case with a pattern as a function parameter
8876+ check (
8877+ r#"struct Foo { a: i32, b: i32 } fn test_9$0(Foo { a, b }: Foo) {}"# ,
8878+ expect ! [ [ r#"
8879+ *test_9*
8880+
8881+ ```rust
8882+ test
8883+ ```
8884+
8885+ ```rust
8886+ fn test_9(Foo { a, b }: Foo)
8887+ ```
8888+ "# ] ] ,
8889+ ) ;
8890+
8891+ // Test case with a pattern as a function parameter with a different name
8892+ check (
8893+ r#"struct Foo { a: i32, b: i32 } fn test_10$0(Foo { a, b: b1 }: Foo) {}"# ,
8894+ expect ! [ [ r#"
8895+ *test_10*
8896+
8897+ ```rust
8898+ test
8899+ ```
8900+
8901+ ```rust
8902+ fn test_10(Foo { a, b: b1 }: Foo)
8903+ ```
8904+ "# ] ] ,
8905+ ) ;
8906+
8907+ // Test case with a pattern as a function parameter with annotations
8908+ check (
8909+ r#"struct Foo { a: i32, b: i32 } fn test_10$0(Foo { a, b: mut b }: Foo) {}"# ,
8910+ expect ! [ [ r#"
8911+ *test_10*
8912+
8913+ ```rust
8914+ test
8915+ ```
8916+
8917+ ```rust
8918+ fn test_10(Foo { a, b: mut b }: Foo)
8919+ ```
8920+ "# ] ] ,
8921+ ) ;
88748922}
0 commit comments