Skip to content

Reference: Mention move keyword for lambdas - #36929

Merged
bors merged 1 commit into
rust-lang:masterfrom
angelsl:issue-36683
Oct 7, 2016
Merged

Reference: Mention move keyword for lambdas#36929
bors merged 1 commit into
rust-lang:masterfrom
angelsl:issue-36683

Conversation

@angelsl

Copy link
Copy Markdown
Contributor

From issue #36683

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @Manishearth

(rust_highfive has picked a reviewer for you, use r? to override)

@steveklabnik

Copy link
Copy Markdown
Contributor

@bors: r+ rollup

thanks so much!

@bors

bors commented Oct 3, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit b00a8a3 has been approved by steveklabnik

@angelsl

Copy link
Copy Markdown
ContributorAuthor

I realise the example is rather trivial and doesn't actually requiremove there...

But I can't think of one that isn't overly complex — I guess there isn't such an example, because to even need move the closure has to live longer than the values it captures i.e. the closure needs to be boxed and stored somewhere else.

@steveklabnik

steveklabnik commented Oct 3, 2016 via email

Copy link
Copy Markdown
Contributor

@frewsxcv

Copy link
Copy Markdown
Contributor

From Travis CI:

failures:
---- Statements_and_expressions_16 stdout ----
error[E0425]: unresolved name `ten_times`
--> <anon>:3:1
|
3 | ten_times(move |j| println!("{}, {}", word, j));
| ^^^^^^^^^ unresolved name
error: aborting due to previous error(s)
thread 'Statements_and_expressions_16' panicked at 'Box<Any>', src/librustc/session/mod.rs:185
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failures:
Statements_and_expressions_16
test result: FAILED. 94 passed; 1 failed; 18 ignored; 0 measured

@angelsl

Copy link
Copy Markdown
ContributorAuthor

Right, I forgot docs are tested and context doesn't carry over. Oops.

On 4 Oct 2016 10:45 AM, "Corey Farwell" notifications@github.com wrote:

From Travis CI:

failures:

---- Statements_and_expressions_16 stdout ----
error[E0425]: unresolved name ten_times
--> :3:1
|
3 | ten_times(move |j| println!("{}, {}", word, j));
| ^^^^^^^^^ unresolved name

error: aborting due to previous error(s)

thread 'Statements_and_expressions_16' panicked at 'Box', src/librustc/session/mod.rs:185
note: Run with RUST_BACKTRACE=1 for a backtrace.

failures:
Statements_and_expressions_16

test result: FAILED. 94 passed; 1 failed; 18 ignored; 0 measured


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#36929 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAOXqPPaz4QowRN4_7kFtI_ehPLcD8Paks5qwb2ogaJpZM4KMvKS
.

@sfackler

Copy link
Copy Markdown
Member

@bors r-

@angelsl

Copy link
Copy Markdown
ContributorAuthor

Alright, this should pass.

@steveklabniksteveklabnik self-assigned this Oct 4, 2016
@steveklabnik

Copy link
Copy Markdown
Contributor

@bors: r+ rollup

thank you!

@bors

bors commented Oct 6, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 58190cc has been approved by steveklabnik

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 7, 2016
Reference: Mention `move` keyword for lambdas
From issue rust-lang#36683
bors added a commit that referenced this pull request Oct 7, 2016
Rollup of 5 pull requests
- Successful merges: #36222, #36665, #36929, #37003, #37008
- Failed merges:
@bors
bors merged commit 58190cc into rust-lang:masterOct 7, 2016
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@angelsl@rust-highfive@steveklabnik@bors@frewsxcv@sfackler@Manishearth