Skip to content

Change vec::{head,tail,init,last} to return references#5213

Closed
erickt wants to merge 9 commits into
rust-lang:incomingfrom
erickt:vec-ref
Closed

Change vec::{head,tail,init,last} to return references#5213
erickt wants to merge 9 commits into
rust-lang:incomingfrom
erickt:vec-ref

Conversation

@erickt

@erickt erickt commented Mar 3, 2013

Copy link
Copy Markdown
Contributor

This patch series changes a handful of vec functions to return references instead of copies. The one downside with making this change is that these functions aren't usable in a couple cases now due to some purity complaints. For example, this change. I couldn't figure out a way to get last to work on a @mut ~[...] type, so I ended up having to use *crate_cache[crate_cache.len() - 1].metas.

@graydon

graydon commented Mar 4, 2013

Copy link
Copy Markdown
Contributor

r+

@erickt

erickt commented Mar 6, 2013

Copy link
Copy Markdown
Contributor Author

@kud1ing: thanks for catching that. I'll fix it.

@erickt

erickt commented Mar 6, 2013

Copy link
Copy Markdown
Contributor Author

I think this should work now. Unfortunately http://buildbot.rust-lang.org is down, so I can't confirm. Can it be retried again?

bors added a commit that referenced this pull request Mar 6, 2013
This patch series changes a handful of vec functions to return references instead of copies. The one downside with making this change is that these functions aren't usable in a couple cases now due to some purity complaints. For example, this [change](erickt@c31e81a#L1R87). I couldn't figure out a way to get `last` to work on a `@mut ~[...]` type, so I ended up having to use `*crate_cache[crate_cache.len() - 1].metas`.
@bors bors closed this Mar 6, 2013
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
Use generator own DefId

Fixes rust-lang#5207

changelog: Fix ICE in `missing_errors_doc`
RalfJung added a commit to RalfJung/rust that referenced this pull request Jul 19, 2026
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.

3 participants