Skip to content

Commit 96fdad2

Browse files
committed
Change 'ret' to 'return' in an error message
1 parent 68bdc09 commit 96fdad2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/rustc/middle/check_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn check_crate(tcx: ty::ctxt, crate: @crate) {
4040
}
4141
expr_ret(oe) => {
4242
if !cx.can_ret {
43-
tcx.sess.span_err(e.span, ~"`ret` in block function");
43+
tcx.sess.span_err(e.span, ~"`return` in block function");
4444
}
4545
visit::visit_expr_opt(oe, cx, v);
4646
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
let _x = || {
3+
return //~ ERROR: `return` in block function
4+
};
5+
}

0 commit comments

Comments
 (0)