@@ -175,9 +175,7 @@ fn check_impl_of_trait(cx: &mut Context, it: &Item, trait_ref: &TraitRef, self_t
175175fn check_item ( cx : & mut Context , item : & Item ) {
176176 if !attr:: contains_name ( item. attrs . as_slice ( ) , "unsafe_destructor" ) {
177177 match item. node {
178- ItemImpl ( _, Some ( ref trait_ref) , ref self_type, _) => {
179- check_impl_of_trait ( cx, item, trait_ref, & * * self_type) ;
180-
178+ ItemImpl ( _, ref trait_ref, ref self_type, _) => {
181179 let parameter_environment =
182180 ParameterEnvironment :: for_item ( cx. tcx , item. id ) ;
183181 cx. parameter_environments . push ( parameter_environment) ;
@@ -188,16 +186,23 @@ fn check_item(cx: &mut Context, item: &Item) {
188186 item. span ,
189187 ty:: node_id_to_type ( cx. tcx , item. id ) ) ;
190188
191- // Check bounds on the trait ref.
192- match ty:: impl_trait_ref ( cx. tcx ,
193- ast_util:: local_def ( item. id ) ) {
194- None => { }
195- Some ( trait_ref) => {
196- check_bounds_on_structs_or_enums_in_trait_ref (
197- cx,
198- item. span ,
199- & * trait_ref) ;
189+ match trait_ref {
190+ & Some ( ref trait_ref) => {
191+ check_impl_of_trait ( cx, item, trait_ref, & * * self_type) ;
192+
193+ // Check bounds on the trait ref.
194+ match ty:: impl_trait_ref ( cx. tcx ,
195+ ast_util:: local_def ( item. id ) ) {
196+ None => { }
197+ Some ( trait_ref) => {
198+ check_bounds_on_structs_or_enums_in_trait_ref (
199+ cx,
200+ item. span ,
201+ & * trait_ref) ;
202+ }
203+ }
200204 }
205+ & None => { }
201206 }
202207
203208 drop ( cx. parameter_environments . pop ( ) ) ;
0 commit comments