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

libstd: Implement some convenience methods on new vectors #12253

Merged
merged 1 commit into from
Feb 21, 2014

Conversation

pcwalton
Copy link
Contributor

r? @brson

@@ -1138,6 +1138,7 @@ impl<'a,T> ImmutableVector<'a, T> for &'a [T] {
}

fn map<U>(&self, f: |t: &T| -> U) -> ~[U] {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this blank line?

@flaper87
Copy link
Contributor

@pcwalton this needs rebase

@pcwalton
Copy link
Contributor Author

rebased, r? @brson


#[inline]
pub fn map<U>(&self, f: |t: &T| -> U) -> Vec<U> {
self.iter().map(f).collect()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep using this definition of map on the new vectors? As I understand it, map on ~[T] is considered deprecated for a long time, as iterators allow one to express the same, and if we ever get Iterable it would conflict anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it makes landing the ~[] removable easier, keep it: someone else can remove it later if necessary.

@bors bors closed this Feb 21, 2014
@bors bors merged commit 03b7910 into rust-lang:master Feb 21, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 26, 2024
…eds-usize, r=Manishearth

fix: ICE when array index exceeds usize

fixes rust-lang#12253

This PR fixes ICE in `indexing_slicing` as it panics when the index of the array exceeds `usize`.

changelog: none
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.

7 participants