Always register sized obligation for argument
This commit is contained in:
parent
6330daade9
commit
0d6da78b06
7 changed files with 57 additions and 22 deletions
|
|
@ -92,10 +92,7 @@ pub(super) fn check_fn<'a, 'tcx>(
|
|||
fcx.check_pat_top(¶m.pat, param_ty, ty_span, None);
|
||||
|
||||
// Check that argument is Sized.
|
||||
// The check for a non-trivial pattern is a hack to avoid duplicate warnings
|
||||
// for simple cases like `fn foo(x: Trait)`,
|
||||
// where we would error once on the parameter as a whole, and once on the binding `x`.
|
||||
if param.pat.simple_ident().is_none() && !params_can_be_unsized {
|
||||
if !params_can_be_unsized {
|
||||
fcx.require_type_is_sized(
|
||||
param_ty,
|
||||
param.pat.span,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue