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 @@ -648,6 +648,14 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
648
648
if let ty:: Param ( param_ty) = ret_kind
649
649
&& param_ty. name == kw:: SelfUpper
650
650
{
651
+ // We expect the return type of an fn call is expected to be
652
+ // `Sized`. In the test `trait-missing-dyn-in-qualified-path.rs`
653
+ // under edition 2018, when writing `<Default>::default()`, we will
654
+ // check both `dyn Default` and `<dyn Default>::default()` for
655
+ // being `Sized`, but in every case where an associated function
656
+ // like `Default::default` which returns `Self`, if the returned
657
+ // value is `!Sized`, so will be the `Self`, so we'd always have
658
+ // two redundat errors.
651
659
return err. delay_as_bug ( ) ;
652
660
}
653
661
}
You can’t perform that action at this time.
0 commit comments