]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/closure.rs
rollup merge of #21438: taralx/kill-racycell
[rust.git] / src / librustc_typeck / check / closure.rs
index 9b25910ab91ab4a13d109c9bf114d8d8e4214dbd..ffec1421f9289ae9512607c3f485c352b460d302 100644 (file)
@@ -50,10 +50,9 @@ pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
 
                     check_unboxed_closure(fcx, expr, kind, decl, body, None);
 
-                    fcx.ccx.tcx.sess.span_err(
-                        expr.span,
-                        "can't infer the \"kind\" of the closure, explicitly annotate it. e.g. \
-                        `|&:| {}`");
+                    span_err!(fcx.ccx.tcx.sess, expr.span, E0187,
+                        "can't infer the \"kind\" of the closure; explicitly annotate it; e.g. \
+                        `|&:| {{}}`");
                 },
                 Some((sig, kind)) => {
                     check_unboxed_closure(fcx, expr, kind, decl, body, Some(sig));