From cb5f9799421c7ae9289295acdf15546a1e68da91 Mon Sep 17 00:00:00 2001 From: gamazeps Date: Wed, 29 Oct 2014 00:59:36 +0100 Subject: Diagnostic: resolve bare fn in expected closure Closes #15273 (I did not find how to get the identifier in the message :/) Also creates the span_help! macro associated with #18126 --- src/test/compile-fail/coerce-bare-fn-to-closure-and-proc.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/compile-fail/coerce-bare-fn-to-closure-and-proc.rs b/src/test/compile-fail/coerce-bare-fn-to-closure-and-proc.rs index c165802d61f..087ebf4e28c 100644 --- a/src/test/compile-fail/coerce-bare-fn-to-closure-and-proc.rs +++ b/src/test/compile-fail/coerce-bare-fn-to-closure-and-proc.rs @@ -13,7 +13,9 @@ fn foo() {} fn main() { let f = foo; let f_closure: || = f; - //~^ ERROR: cannot coerce non-statically resolved bare fn + //~^ ERROR: cannot coerce non-statically resolved bare fn to closure + //~^ HELP: consider embedding the function in a closure let f_proc: proc() = f; - //~^ ERROR: cannot coerce non-statically resolved bare fn + //~^ ERROR: cannot coerce non-statically resolved bare fn to closure + //~^ HELP: consider embedding the function in a closure } -- cgit 1.4.1-3-g733a5