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 8, 2024
1 parent 7134a2b commit 5d8b31a
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,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 5d8b31a

Please sign in to comment.