diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-20 14:07:19 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-20 14:07:19 +0000 |
commit | 459e10eb74796aeae78c1e741289881365d360f0 (patch) | |
tree | c14787b0446e8c01d3794c796eb290bb4f208465 /crates/assists/src/handlers | |
parent | ba3a5c518a4e20ddacad05d7a8a67704ca2b2a9a (diff) | |
parent | d8559588c0a38ef1c2cfcb297b520469e6765c80 (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.rs | 25 |
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 {} | ||
129 | struct Struct<T>$0 | ||
130 | where | ||
131 | T: Trait, | ||
132 | { | ||
133 | inner: T, | ||
134 | }"#, | ||
135 | r#"pub trait Trait {} | ||
136 | struct Struct<T> | ||
137 | where | ||
138 | T: Trait, | ||
139 | { | ||
140 | inner: T, | ||
141 | } | ||
142 | |||
143 | impl<T> Struct<T> | ||
144 | where | ||
145 | T: Trait, | ||
146 | { | ||
147 | $0 | ||
148 | }"#, | ||
149 | ); | ||
125 | } | 150 | } |
126 | 151 | ||
127 | #[test] | 152 | #[test] |