We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6d9050 commit 5f22c02Copy full SHA for 5f22c02
compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
@@ -648,6 +648,14 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
648
if let ty::Param(param_ty) = ret_kind
649
&& param_ty.name == kw::SelfUpper
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.
659
return err.delay_as_bug();
660
}
661
0 commit comments