Skip to content

Improve the attempted dynamic environment-capture error message #7531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2013

Conversation

ngsankha
Copy link
Contributor

@ngsankha ngsankha commented Jul 1, 2013

This pull request fixes #7118.

@bblum
Copy link
Contributor

bblum commented Jul 1, 2013

There's also a way to emit this error message in middle/resolve.rs. Please change that one too.

After dealing with that, and addressing my above error-pattern comment, I'll give r+.

@kud1ing
Copy link

kud1ing commented Jul 3, 2013

One nitpick. I think fn as in "fn item" should be enclosed in backticks.

bors added a commit that referenced this pull request Jul 3, 2013
@bors bors closed this Jul 3, 2013
@bors bors merged commit af30fe2 into rust-lang:master Jul 3, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 3, 2021
Manual map 7413

fixes: rust-lang#7413

This only fixes the specific problem from rust-lang#7413, not the general case. The full fix requires interacting with the borrow checker to determine the lifetime of all the borrows made in the function. I'll open an issue about it later.

changelog: Don't suggest using `map` when the option is borrowed in the match, and also consumed in the arm.
changelog: Locals declared within the would-be closure will not prevent the closure from being suggested in `manual_map` and `map_entry`
Sign up for free to 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.

RFC: "attempted dynamic environment-capture" is a bad error message
4 participants