Skip to content
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

Revert map.each to something which takes two parameters rather than a tuple. #5796

Merged
merged 1 commit into from
Apr 10, 2013

Conversation

nikomatsakis
Copy link
Contributor

Revert map.each to something which takes two parameters rather than a tuple. The current setup iterates over BaseIter<(&'self K, &'self V)> where 'self is a lifetime declared in the each() method. You can't place such a type in the impl declaration. The compiler currently allows it, but this will not be legal under #5656 and I'm pretty sure it's not sound now. It's too bad that maps can't implement BaseIter (at least not over a tuple as they do here) but I think it has to be this way for the time being.

r? @thestinger

rather than a tuple.  The current setup iterates over
`BaseIter<(&'self K, &'self V)>` where 'self is a lifetime declared
*in the each method*.  You can't place such a type in
the impl declaration.  The compiler currently allows it,
but this will not be legal under rust-lang#5656 and I'm pretty sure
it's not sound now.
bors added a commit that referenced this pull request Apr 10, 2013
… r=nikomatsakis

Revert map.each to something which takes two parameters rather than a tuple.  The current setup iterates over `BaseIter<(&'self K, &'self V)>` where 'self is a lifetime declared *in the `each()` method*.  You can't place such a type in the impl declaration.  The compiler currently allows it, but this will not be legal under #5656 and I'm pretty sure it's not sound now.  It's too bad that maps can't implement `BaseIter` (at least not over a tuple as they do here) but I think it has to be this way for the time being.

r? @thestinger
@bors bors closed this Apr 10, 2013
@bors bors merged commit 5606fc0 into rust-lang:incoming Apr 10, 2013
@nikomatsakis nikomatsakis deleted the issue-5656-fix-map-iteration branch March 30, 2016 16:15
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 28, 2020
…le_const, r=oli-obk

Fix fp in `borrow_interior_mutable_const`

fixes rust-lang#5796

changelog: fix false positive in `borrow_interior_mutable_const` when referencing a field behind a pointer.
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.

None yet

2 participants