File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
compiler/rustc_trait_selection/src/traits/error_reporting Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -649,6 +649,14 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
649649 if let ty:: Param ( param_ty) = ret_kind
650650 && param_ty. name == kw:: SelfUpper
651651 {
652+ // We expect the return type of an fn call is expected to be
653+ // `Sized`. In the test `trait-missing-dyn-in-qualified-path.rs`
654+ // under edition 2018, when writing `<Default>::default()`, we will
655+ // check both `dyn Default` and `<dyn Default>::default()` for
656+ // being `Sized`, but in every case where an associated function
657+ // like `Default::default` which returns `Self`, if the returned
658+ // value is `!Sized`, so will be the `Self`, so we'd always have
659+ // two redundat errors.
652660 return err. delay_as_bug ( ) ;
653661 }
654662 }
You can’t perform that action at this time.
0 commit comments