Skip to content

Commit cb1c028

Browse files
committed
---
yaml --- r: 63481 b: refs/heads/snap-stage3 c: 3ba8404 h: refs/heads/master i: 63479: d40b7a4 v: v3
1 parent a212dc7 commit cb1c028

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 643be38cfe269effdc02111677559f74385b1056
4+
refs/heads/snap-stage3: 3ba8404c88972f2324ce97fa7e5a433399d946ed
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/borrowck/gather_loans/gather_moves.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,14 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
115115
// These are separate from the above cases for a better error message.
116116
mc::cat_stack_upvar(*) |
117117
mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Many, _ }) => {
118+
let once_hint = if bccx.tcx.sess.once_fns() {
119+
" (unless the destination closure type is `once fn')"
120+
} else {
121+
""
122+
};
118123
bccx.span_err(
119124
cmt0.span,
120-
fmt!("cannot move out of %s \
121-
(unless the destination closure type is `once fn')",
122-
bccx.cmt_to_str(cmt)));
125+
fmt!("cannot move out of %s%s", bccx.cmt_to_str(cmt), once_hint));
123126
false
124127
}
125128

0 commit comments

Comments
 (0)