@@ -145,8 +145,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedResults {
145145 match ty. sty {
146146 ty:: Adt ( ..) if ty. is_box ( ) => {
147147 let boxed_ty = ty. boxed_ty ( ) ;
148- let descr_pre_path = format ! ( "{}boxed " , descr_pre_path) ;
149- check_must_use_ty ( cx, boxed_ty, expr, span, & descr_pre_path, descr_post_path)
148+ let descr_pre_path = & format ! ( "{}boxed " , descr_pre_path) ;
149+ check_must_use_ty ( cx, boxed_ty, expr, span, descr_pre_path, descr_post_path)
150150 }
151151 ty:: Adt ( def, _) => {
152152 check_must_use_def ( cx, def. did , span, descr_pre_path, descr_post_path)
@@ -157,8 +157,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedResults {
157157 if let ty:: Predicate :: Trait ( ref poly_trait_predicate) = predicate {
158158 let trait_ref = poly_trait_predicate. skip_binder ( ) . trait_ref ;
159159 let def_id = trait_ref. def_id ;
160- let descr_pre = format ! ( "{}implementer of " , descr_pre_path) ;
161- if check_must_use_def ( cx, def_id, span, & descr_pre, descr_post_path) {
160+ let descr_pre = & format ! ( "{}implementer of " , descr_pre_path) ;
161+ if check_must_use_def ( cx, def_id, span, descr_pre, descr_post_path) {
162162 has_emitted = true ;
163163 break ;
164164 }
@@ -171,7 +171,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedResults {
171171 for predicate in binder. skip_binder ( ) . iter ( ) {
172172 if let ty:: ExistentialPredicate :: Trait ( ref trait_ref) = predicate {
173173 let def_id = trait_ref. def_id ;
174- let descr_post = " trait object" ;
174+ let descr_post = & format ! ( " trait object{}" , descr_post_path ) ;
175175 if check_must_use_def ( cx, def_id, span, descr_pre_path, descr_post) {
176176 has_emitted = true ;
177177 break ;
0 commit comments