aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-20 14:07:19 +0000
committerGitHub <[email protected]>2021-02-20 14:07:19 +0000
commit459e10eb74796aeae78c1e741289881365d360f0 (patch)
treec14787b0446e8c01d3794c796eb290bb4f208465 /crates/assists/src/handlers
parentba3a5c518a4e20ddacad05d7a8a67704ca2b2a9a (diff)
parentd8559588c0a38ef1c2cfcb297b520469e6765c80 (diff)
Merge #7725
7725: fix(assist): display where predicates when we want to generate impl r=lnicola a=bnjjj close #7721 Co-authored-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/assists/src/handlers')
-rw-r--r--crates/assists/src/handlers/generate_impl.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/assists/src/handlers/generate_impl.rs b/crates/assists/src/handlers/generate_impl.rs
index 16a600e6f..a8e3c4fc2 100644
--- a/crates/assists/src/handlers/generate_impl.rs
+++ b/crates/assists/src/handlers/generate_impl.rs
@@ -122,6 +122,31 @@ mod tests {
122 $0 122 $0
123 }"#, 123 }"#,
124 ); 124 );
125
126 check_assist(
127 generate_impl,
128 r#"pub trait Trait {}
129struct Struct<T>$0
130where
131 T: Trait,
132{
133 inner: T,
134}"#,
135 r#"pub trait Trait {}
136struct Struct<T>
137where
138 T: Trait,
139{
140 inner: T,
141}
142
143impl<T> Struct<T>
144where
145 T: Trait,
146{
147 $0
148}"#,
149 );
125 } 150 }
126 151
127 #[test] 152 #[test]