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