address Niko's comments
This commit is contained in:
parent
ab0c7af376
commit
79af277623
1 changed files with 2 additions and 2 deletions
|
@ -45,14 +45,14 @@ pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
|
||||||
// that, otherwise we'll fall back to boxed closures.
|
// that, otherwise we'll fall back to boxed closures.
|
||||||
match expected_sig_and_kind {
|
match expected_sig_and_kind {
|
||||||
None => { // don't have information about the kind, request explicit annotation
|
None => { // don't have information about the kind, request explicit annotation
|
||||||
// HACK We still need to typeck the body, so assume `FnMut` kind just for that
|
// NB We still need to typeck the body, so assume `FnMut` kind just for that
|
||||||
let kind = ty::FnMutUnboxedClosureKind;
|
let kind = ty::FnMutUnboxedClosureKind;
|
||||||
|
|
||||||
check_unboxed_closure(fcx, expr, kind, decl, body, None);
|
check_unboxed_closure(fcx, expr, kind, decl, body, None);
|
||||||
|
|
||||||
fcx.ccx.tcx.sess.span_err(
|
fcx.ccx.tcx.sess.span_err(
|
||||||
expr.span,
|
expr.span,
|
||||||
"Can't infer the \"kind\" of the closure, explicitly annotate it. e.g. \
|
"can't infer the \"kind\" of the closure, explicitly annotate it. e.g. \
|
||||||
`|&:| {}`");
|
`|&:| {}`");
|
||||||
},
|
},
|
||||||
Some((sig, kind)) => {
|
Some((sig, kind)) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue