Change 'ret' to 'return' in an error message
This commit is contained in:
parent
68bdc09650
commit
96fdad2fb7
@ -40,7 +40,7 @@ fn check_crate(tcx: ty::ctxt, crate: @crate) {
|
||||
}
|
||||
expr_ret(oe) => {
|
||||
if !cx.can_ret {
|
||||
tcx.sess.span_err(e.span, ~"`ret` in block function");
|
||||
tcx.sess.span_err(e.span, ~"`return` in block function");
|
||||
}
|
||||
visit::visit_expr_opt(oe, cx, v);
|
||||
}
|
||||
|
5
src/test/compile-fail/return-in-block-function.rs
Normal file
5
src/test/compile-fail/return-in-block-function.rs
Normal file
@ -0,0 +1,5 @@
|
||||
fn main() {
|
||||
let _x = || {
|
||||
return //~ ERROR: `return` in block function
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user