@@ -168,6 +168,7 @@ pub fn inner_lombok_data(
168168 }
169169 } )
170170 . collect ( ) ;
171+ let where_clause: & Option < WhereClause > = & input. generics . where_clause ;
171172 let methods: Vec < NewTokenStream > = match input. data {
172173 Data :: Struct ( ref s) => s
173174 . fields
@@ -179,15 +180,15 @@ pub fn inner_lombok_data(
179180 let expanded: NewTokenStream = if lifetimes. is_empty ( ) {
180181 if type_bounds. is_empty ( ) {
181182 quote ! {
182- impl #name {
183+ impl #name #where_clause {
183184 #( #methods) *
184185 }
185186 }
186187 } else {
187188 let type_bounds_generics: NewTokenStream = quote ! { #( #type_bounds) , * } ;
188189 let type_generics: NewTokenStream = quote ! { #( #types) , * } ;
189190 quote ! {
190- impl <#type_bounds_generics> #name<#type_generics> {
191+ impl <#type_bounds_generics> #name<#type_generics> #where_clause {
191192 #( #methods) *
192193 }
193194 }
@@ -196,15 +197,15 @@ pub fn inner_lombok_data(
196197 let lifetimes_generics: NewTokenStream = quote ! { #( #lifetimes) , * } ;
197198 if type_bounds. is_empty ( ) {
198199 quote ! {
199- impl <#lifetimes_generics> #name<#lifetimes_generics> {
200+ impl <#lifetimes_generics> #name<#lifetimes_generics> #where_clause {
200201 #( #methods) *
201202 }
202203 }
203204 } else {
204205 let type_bounds_generics: NewTokenStream = quote ! { #( #type_bounds) , * } ;
205206 let type_generics: NewTokenStream = quote ! { #( #types) , * } ;
206207 quote ! {
207- impl <#lifetimes_generics, #type_bounds_generics> #name<#lifetimes_generics, #type_generics> {
208+ impl <#lifetimes_generics, #type_bounds_generics> #name<#lifetimes_generics, #type_generics> #where_clause {
208209 #( #methods) *
209210 }
210211 }
0 commit comments