Skip to content

Commit

Permalink
Add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jun 10, 2024
1 parent 71e0a76 commit a16f296
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,14 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
if let ty::Param(param_ty) = ret_kind
&& param_ty.name == kw::SelfUpper
{
// We expect the return type of an fn call is expected to be
// `Sized`. In the test `trait-missing-dyn-in-qualified-path.rs`
// under edition 2018, when writing `<Default>::default()`, we will
// check both `dyn Default` and `<dyn Default>::default()` for
// being `Sized`, but in every case where an associated function
// like `Default::default` which returns `Self`, if the returned
// value is `!Sized`, so will be the `Self`, so we'd always have
// two redundat errors.
return err.delay_as_bug();
}
}
Expand Down

0 comments on commit a16f296

Please sign in to comment.