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 @@ -639,20 +639,17 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
639639 err. span_label ( span, explanation) ;
640640 }
641641
642- if Some ( trait_ref. def_id ( ) ) == self . tcx . lang_items ( ) . sized_trait ( ) {
643- if !self . tcx . object_safety_violations ( trait_ref. def_id ( ) ) . is_empty ( ) {
644- if let ObligationCauseCode :: SizedCallReturnType ( did)
645- = obligation. cause . code ( )
646- {
647- let fn_sig = self . tcx . fn_sig ( did) ;
648- let ret_kind =
649- fn_sig. skip_binder ( ) . output ( ) . skip_binder ( ) . kind ( ) ;
650- if let ty:: Param ( param_ty) = ret_kind
651- && param_ty. name == kw:: SelfUpper
652- {
653- return err. delay_as_bug ( ) ;
654- }
655- }
642+ if Some ( trait_ref. def_id ( ) ) == self . tcx . lang_items ( ) . sized_trait ( )
643+ && 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 ( ) ;
656653 }
657654 }
658655
You can’t perform that action at this time.
0 commit comments