We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 643be38 commit 3ba8404Copy full SHA for 3ba8404
src/librustc/middle/borrowck/gather_loans/gather_moves.rs
@@ -115,11 +115,14 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
115
// These are separate from the above cases for a better error message.
116
mc::cat_stack_upvar(*) |
117
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
+ };
123
bccx.span_err(
124
cmt0.span,
- fmt!("cannot move out of %s \
- (unless the destination closure type is `once fn')",
- bccx.cmt_to_str(cmt)));
125
+ fmt!("cannot move out of %s%s", bccx.cmt_to_str(cmt), once_hint));
126
false
127
}
128
0 commit comments