Skip to content

Put Vec in with the rest of the collections #34944

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/libstd/collections/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ pub use core_collections::{LinkedList, VecDeque};
pub use core_collections::{binary_heap, btree_map, btree_set};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core_collections::{linked_list, vec_deque};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core_collections::vec::{self, Vec};

#[stable(feature = "rust1", since = "1.0.0")]
pub use self::hash_map::HashMap;
Expand Down
14 changes: 10 additions & 4 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@
//! atomically-reference-counted box, [`Arc`], with a [`Mutex`] to get the same
//! effect.
//!
//! The [`collections`] module defines maps, sets, linked lists and other
//! typical collection types, including the common [`HashMap<K, V>`].
//! The [`collections`] module defines maps, sets, sequences and other typical
//! collection types, including the common [`Vec<T>`] and [`HashMap<K, V>`].
//!
//! ## Platform abstractions and I/O
//!
Expand Down Expand Up @@ -169,7 +169,7 @@
//! [`RefCell`]: cell/struct.RefCell.html
//! [`Result<T, E>`]: result/enum.Result.html
//! [`String`]: string/struct.String.html
//! [`Vec<T>`]: vec/index.html
//! [`Vec<T>`]: collections/vec/index.html
//! [array]: primitive.array.html
//! [slice]: primitive.slice.html
//! [`atomic`]: sync/atomic/index.html
Expand Down Expand Up @@ -367,8 +367,14 @@ pub use core_collections::slice;
pub use core_collections::str;
#[stable(feature = "rust1", since = "1.0.0")]
pub use core_collections::string;
#[rustc_deprecated(since = "1.12.0")]
#[stable(feature = "rust1", since = "1.0.0")]
pub use core_collections::vec;
pub mod vec {
//! `Vec<T>` used to be in its own module, separate from the rest of the
//! collections. This re-export is included for backwards compatibility.
#[stable(feature = "rust1", since = "1.0.0")]
pub use core_collections::vec::*;
}

#[stable(feature = "rust1", since = "1.0.0")]
pub use rustc_unicode::char;
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/fn-item-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fn main() {
eq(bar::<String>, bar::<Vec<u8>>);
//~^ ERROR mismatched types
//~| expected type `fn(isize) -> isize {bar::<std::string::String>}`
//~| found type `fn(isize) -> isize {bar::<std::vec::Vec<u8>>}`
//~| expected struct `std::string::String`, found struct `std::vec::Vec`
//~| found type `fn(isize) -> isize {bar::<std::collections::Vec<u8>>}`
//~| expected struct `std::string::String`, found struct `std::collections::Vec`

// Make sure we distinguish between trait methods correctly.
eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-24819.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() {
let mut v = Vec::new();
foo(&mut v);
//~^ ERROR mismatched types
//~| expected struct `std::collections::HashSet`, found struct `std::vec::Vec`
//~| expected struct `std::collections::HashSet`, found struct `std::collections::Vec`
}

fn foo(h: &mut HashSet<u32>) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/on-unimplemented/on-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn main() {
let x = vec!(1u8, 2, 3, 4);
let y: Option<Vec<u8>> = collect(x.iter()); // this should give approximately the same error for x.iter().collect()
//~^ ERROR
//~^^ NOTE a collection of type `std::option::Option<std::vec::Vec<u8>>` cannot be built from an iterator over elements of type `&u8`
//~^^ NOTE a collection of type `std::option::Option<std::collections::Vec<u8>>` cannot be built from an iterator over elements of type `&u8`
//~^^^ NOTE required by `collect`
let x: String = foobar(); //~ ERROR
//~^ NOTE test error `std::string::String` with `u8` `_` `u32`
Expand Down