rust/src/test/ui/issues/issue-17651.rs
Esteban Kuber 4951e3ad9e Point at argument when evaluating Path's bounds
When evaluating an `ExprKind::Call`, we first have to `check_expr` on it's
callee. When this one is a `ExprKind::Path`, we had to evaluate the bounds
introduced for its arguments, but by the time we evaluated them we no
longer had access to the argument spans. Now we special case this so
that we can point at the right place on unsatisfied bounds. This also
allows the E0277 deduplication to kick in correctly, so we now emit
fewer errors.
2021-09-16 12:12:28 +00:00

8 lines
173 B
Rust

// Test that moves of unsized values within closures are caught
// and rejected.
fn main() {
(|| Box::new(*(&[0][..])))();
//~^ ERROR the size for values of type
}