File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
compiler/rustc_trait_selection/src/traits/error_reporting Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -638,20 +638,17 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
638638 err. span_label ( span, explanation) ;
639639 }
640640
641- if Some ( trait_ref. def_id ( ) ) == self . tcx . lang_items ( ) . sized_trait ( ) {
642- if !self . tcx . object_safety_violations ( trait_ref. def_id ( ) ) . is_empty ( ) {
643- if let ObligationCauseCode :: SizedCallReturnType ( did)
644- = obligation. cause . code ( )
645- {
646- let fn_sig = self . tcx . fn_sig ( did) ;
647- let ret_kind =
648- fn_sig. skip_binder ( ) . output ( ) . skip_binder ( ) . kind ( ) ;
649- if let ty:: Param ( param_ty) = ret_kind
650- && param_ty. name == kw:: SelfUpper
651- {
652- return err. delay_as_bug ( ) ;
653- }
654- }
641+ if Some ( trait_ref. def_id ( ) ) == self . tcx . lang_items ( ) . sized_trait ( )
642+ && let ObligationCauseCode :: SizedCallReturnType ( did)
643+ = obligation. cause . code ( )
644+ {
645+ let fn_sig = self . tcx . fn_sig ( did) ;
646+ let ret_kind =
647+ fn_sig. skip_binder ( ) . output ( ) . skip_binder ( ) . kind ( ) ;
648+ if let ty:: Param ( param_ty) = ret_kind
649+ && param_ty. name == kw:: SelfUpper
650+ {
651+ return err. delay_as_bug ( ) ;
655652 }
656653 }
657654
You can’t perform that action at this time.
0 commit comments