about summary refs log tree commit diff
path: root/src/libsyntax/util/small_vector.rs
AgeCommit message (Collapse)AuthorLines
2015-12-13remove deprecated APIs missed in #30182Tamir Duberstein-7/+0
2015-11-26Some TLC for the MoveMap traitMarvin Löbel-17/+23
2015-11-20Rename #[deprecated] to #[rustc_deprecated]Vadim Petrochenkov-1/+1
2015-11-10Use lifetime elisionSeo Sanghyeon-2/+2
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-1/+0
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-13Refactor attr::StabilityVadim Petrochenkov-1/+1
Stricter checking + enforcement of invariants at compile time
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-21syntax: Don't use unstable fn to convert single element to a sliceErick Tryzelaar-1/+4
2015-04-10Simplifications to statement macro handling.Christopher Chambers-23/+1
SmallVector::pop no longer worries about converting a Many repr downward to One or Zero. expand_stmt makes use of `if let` for style purposes.
2015-04-10Improves semicolon expansion efficiency, corrects bt_pop placement.Christopher Chambers-0/+36
Implements pop() on SmallVector, and uses it to expand the final semicolon in a statement macro expansion more efficiently. Corrects the placement of the call to fld.cx.bt_pop(). It must run unconditionally to reverse the corresponding push.
2015-03-31std: Remove #[old_orphan_check] from PartialEqAlex Crichton-3/+3
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). cc #19470 [breaking-change]
2015-03-09Rename #[should_fail] to #[should_panic]Steven Fackler-2/+2
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-2/+2
2015-02-18make FromIterator use IntoIteratorAlexis-1/+1
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18make Extend use IntoIteratorAlexis-2/+2
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of Extend should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-1/+1
2015-02-02remove unused mut qualifiersJorge Aparicio-1/+1
2015-01-31Kill more `isize`sTobias Bucher-11/+11
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-17/+17
Conflicts: mk/tests.mk src/liballoc/arc.rs src/liballoc/boxed.rs src/liballoc/rc.rs src/libcollections/bit.rs src/libcollections/btree/map.rs src/libcollections/btree/set.rs src/libcollections/dlist.rs src/libcollections/ring_buf.rs src/libcollections/slice.rs src/libcollections/str.rs src/libcollections/string.rs src/libcollections/vec.rs src/libcollections/vec_map.rs src/libcore/any.rs src/libcore/array.rs src/libcore/borrow.rs src/libcore/error.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/ops.rs src/libcore/result.rs src/libcore/slice.rs src/libcore/str/mod.rs src/libregex/lib.rs src/libregex/re.rs src/librustc/lint/builtin.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/mutex.rs src/libstd/sync/poison.rs src/libstd/sync/rwlock.rs src/libsyntax/feature_gate.rs src/libsyntax/test.rs
2015-01-23Deprecated attributes don't take 'feature' names and are paired with ↵Brian Anderson-1/+2
stable/unstable Conflicts: src/libcore/atomic.rs src/libcore/finally.rs src/test/auxiliary/inherited_stability.rs src/test/auxiliary/lint_stability.rs
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-1/+1
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-10/+10
2015-01-18libsyntax: int types -> isizePaul Collier-4/+4
2015-01-17libsyntax: uint types to usizePaul Collier-3/+3
2015-01-03syntax: fix falloutJorge Aparicio-3/+5
2015-01-02std: Stabilize the prelude moduleAlex Crichton-0/+2
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2014-12-22Renaming of the Iter types as in RFC #344Florian Wilkens-9/+9
libcore: slice::Items -> slice::Iter, slice::MutItems -> slice::IterMut libcollections: *::Items -> *::Iter, *::MoveItems -> *::IntoIter, *::MutItems -> *::IterMut This is of course a [breaking-change].
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-1/+1
2014-12-03Fix falloutJorge Aparicio-2/+2
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+2
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-08Renamed Extendable to Extendgamazeps-1/+1
In order to upgrade, simply rename the Extendable trait to Extend in your code Part of #18424 [breaking-change]
2014-11-01collections: Remove all collections traitsAlex Crichton-10/+10
As part of the collections reform RFC, this commit removes all collections traits in favor of inherent methods on collections themselves. All methods should continue to be available on all collections. This is a breaking change with all of the collections traits being removed and no longer being in the prelude. In order to update old code you should move the trait implementations to inherent implementations directly on the type itself. Note that some traits had default methods which will also need to be implemented to maintain backwards compatibility. [breaking-change] cc #18424
2014-10-29Rename fail! to panic!Steve Klabnik-3/+3
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-1/+1
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-09-16Fallout from renamingAaron Turon-7/+13
2014-09-14syntax: fold: use move semantics for efficient folding.Eduard Burtescu-1/+14
2014-08-26DST coercions and DST structsNick Cameron-1/+4
[breaking-change] 1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code. 2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible. 3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-3/+3
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-8/+8
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-08core: Rename `container` mod to `collections`. Closes #12543Brian Anderson-1/+1
Also renames the `Container` trait to `Collection`. [breaking-change]
2014-04-22rustc: de-@ middle::ty.Eduard Burtescu-0/+9
2014-04-15Remove usage of private enum variantsAlex Crichton-25/+34
This replaces all uses of private enum variants with a struct that has one private field pointing at a private enum. RFC: 0006-remove-priv
2014-03-30Rename `from_iterator` to `from_iter` for consistency.Brian Anderson-2/+2
2014-03-25Changed `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by ↵Marvin Löbel-6/+4
value
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-3/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-4/+4
Closes #12771
2014-03-04Expand nested items within a backtrace.Nick Cameron-0/+8
Fixes a regression from #4913 which causes items to be exanded with spans lacking expn_info from the context's current backtrace.
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-3/+7
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-12/+12
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-1/+7
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.