aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/assists/src/handlers/replace_impl_trait_with_generic.rs18
-rw-r--r--crates/assists/src/tests/generated.rs2
-rw-r--r--crates/syntax/src/ast/edit.rs1
3 files changed, 10 insertions, 11 deletions
diff --git a/crates/assists/src/handlers/replace_impl_trait_with_generic.rs b/crates/assists/src/handlers/replace_impl_trait_with_generic.rs
index 748c528d4..6738bc134 100644
--- a/crates/assists/src/handlers/replace_impl_trait_with_generic.rs
+++ b/crates/assists/src/handlers/replace_impl_trait_with_generic.rs
@@ -11,7 +11,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists};
11// ``` 11// ```
12// -> 12// ->
13// ``` 13// ```
14// fn foo<B: Bar,>(bar: B) {} 14// fn foo<B: Bar>(bar: B) {}
15// ``` 15// ```
16pub(crate) fn replace_impl_trait_with_generic( 16pub(crate) fn replace_impl_trait_with_generic(
17 acc: &mut Assists, 17 acc: &mut Assists,
@@ -59,7 +59,7 @@ mod tests {
59 fn foo<G>(bar: <|>impl Bar) {} 59 fn foo<G>(bar: <|>impl Bar) {}
60 "#, 60 "#,
61 r#" 61 r#"
62 fn foo<G, B: Bar,>(bar: B) {} 62 fn foo<G, B: Bar>(bar: B) {}
63 "#, 63 "#,
64 ); 64 );
65 } 65 }
@@ -72,7 +72,7 @@ mod tests {
72 fn foo(bar: <|>impl Bar) {} 72 fn foo(bar: <|>impl Bar) {}
73 "#, 73 "#,
74 r#" 74 r#"
75 fn foo<B: Bar,>(bar: B) {} 75 fn foo<B: Bar>(bar: B) {}
76 "#, 76 "#,
77 ); 77 );
78 } 78 }
@@ -85,7 +85,7 @@ mod tests {
85 fn foo<G>(foo: impl Foo, bar: <|>impl Bar) {} 85 fn foo<G>(foo: impl Foo, bar: <|>impl Bar) {}
86 "#, 86 "#,
87 r#" 87 r#"
88 fn foo<G, B: Bar,>(foo: impl Foo, bar: B) {} 88 fn foo<G, B: Bar>(foo: impl Foo, bar: B) {}
89 "#, 89 "#,
90 ); 90 );
91 } 91 }
@@ -98,7 +98,7 @@ mod tests {
98 fn foo<>(bar: <|>impl Bar) {} 98 fn foo<>(bar: <|>impl Bar) {}
99 "#, 99 "#,
100 r#" 100 r#"
101 fn foo<B: Bar,>(bar: B) {} 101 fn foo<B: Bar>(bar: B) {}
102 "#, 102 "#,
103 ); 103 );
104 } 104 }
@@ -112,7 +112,7 @@ mod tests {
112 >(bar: <|>impl Bar) {} 112 >(bar: <|>impl Bar) {}
113 "#, 113 "#,
114 r#" 114 r#"
115 fn foo<B: Bar, 115 fn foo<B: Bar
116 >(bar: B) {} 116 >(bar: B) {}
117 "#, 117 "#,
118 ); 118 );
@@ -127,7 +127,7 @@ mod tests {
127 fn foo<B>(bar: <|>impl Bar) {} 127 fn foo<B>(bar: <|>impl Bar) {}
128 "#, 128 "#,
129 r#" 129 r#"
130 fn foo<B, C: Bar,>(bar: C) {} 130 fn foo<B, C: Bar>(bar: C) {}
131 "#, 131 "#,
132 ); 132 );
133 } 133 }
@@ -147,7 +147,7 @@ mod tests {
147 fn foo< 147 fn foo<
148 G: Foo, 148 G: Foo,
149 F, 149 F,
150 H, B: Bar, 150 H, B: Bar
151 >(bar: B) {} 151 >(bar: B) {}
152 "#, 152 "#,
153 ); 153 );
@@ -161,7 +161,7 @@ mod tests {
161 fn foo(bar: <|>impl Foo + Bar) {} 161 fn foo(bar: <|>impl Foo + Bar) {}
162 "#, 162 "#,
163 r#" 163 r#"
164 fn foo<F: Foo + Bar,>(bar: F) {} 164 fn foo<F: Foo + Bar>(bar: F) {}
165 "#, 165 "#,
166 ); 166 );
167 } 167 }
diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs
index 4e5ca3825..27d15adb0 100644
--- a/crates/assists/src/tests/generated.rs
+++ b/crates/assists/src/tests/generated.rs
@@ -822,7 +822,7 @@ fn doctest_replace_impl_trait_with_generic() {
822fn foo(bar: <|>impl Bar) {} 822fn foo(bar: <|>impl Bar) {}
823"#####, 823"#####,
824 r#####" 824 r#####"
825fn foo<B: Bar,>(bar: B) {} 825fn foo<B: Bar>(bar: B) {}
826"#####, 826"#####,
827 ) 827 )
828} 828}
diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs
index 5b5454c72..8b1c65dd6 100644
--- a/crates/syntax/src/ast/edit.rs
+++ b/crates/syntax/src/ast/edit.rs
@@ -492,7 +492,6 @@ impl ast::GenericParamList {
492 to_insert.push(space.into()); 492 to_insert.push(space.into());
493 } 493 }
494 to_insert.push(item.syntax().clone().into()); 494 to_insert.push(item.syntax().clone().into());
495 to_insert.push(make::token(T![,]).into());
496 495
497 macro_rules! after_l_angle { 496 macro_rules! after_l_angle {
498 () => {{ 497 () => {{