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

[RFC] add IndexAssign trait #25628

Closed
wants to merge 1 commit into from
Closed

Conversation

japaric
Copy link
Member

@japaric japaric commented May 19, 2015

Do not merge until its RFC has been approved

Introduce an unstable IndexAssign trait that lets users overload the a[b] = c expression.

Restore IndexMut implementations on HashMap/BTreeMap and also make them implement the IndexAssign trait, all these operations are now supported:

// insertion
map[key] = value

// apply mutating method to value associated to `key`
map[&key].foo_mut()

// get mutable reference to value associated to `key`
&mut map[&key]

RFC: rust-lang/rfcs#1129

cc @sfackler @gankro @nikomatsakis @aturon

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@japaric
Copy link
Member Author

japaric commented May 19, 2015

RFC at rust-lang/rfcs#1129

@alexcrichton
Copy link
Member

/me gasps

Nice!

r? @nikomatsakis, @nrc, and/or @pnkfelix

@alexcrichton
Copy link
Member

cc @aturon

@Gankra
Copy link
Contributor

Gankra commented May 19, 2015

🌞

@bors
Copy link
Contributor

bors commented May 24, 2015

☔ The latest upstream changes (presumably #25609) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton alexcrichton added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Jun 2, 2015
@japaric japaric force-pushed the index-assign branch 3 times, most recently from 87db6f1 to 04128bd Compare June 15, 2015 22:44
@bors
Copy link
Contributor

bors commented Jun 20, 2015

☔ The latest upstream changes (presumably #26411) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Jun 27, 2015

☔ The latest upstream changes (presumably #26575) made this pull request unmergeable. Please resolve the merge conflicts.

@Gankra
Copy link
Contributor

Gankra commented Jul 27, 2015

(not closing this one since it looks like its RFC is getting into FCP soon)

@bors
Copy link
Contributor

bors commented Sep 24, 2015

☔ The latest upstream changes (presumably #28602) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton
Copy link
Member

I'm going to close this for now while we sit on the RFC, but this should always be here for posterity at least!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants