about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-09-17Pacify lint gods.Vadim Chugunov-2/+3
2014-09-17Remove unstable marker from std::rtAaron Turon-1/+0
The `std::rt` module was marked `unstable` [a while back](https://github.com/rust-lang/rust/commit/b6d4d117f4c2770649c7ddc2ad9ad4ce4c3b13b1), and this change was not reverted when we moved to an `experimental` baseline for `std`.
2014-09-17rollup merge of #17326 : brson/wintestAlex Crichton-2/+2
2014-09-17rollup merge of #17297 : treeman/net-unixAlex Crichton-5/+4
2014-09-17auto merge of #17254 : gamazeps/rust/issue17210, r=alexcrichtonbors-0/+1
Closes #17210
2014-09-17doc: Cleanup.Jonas Hietala-6/+6
Remove ~~~ for code block specification. Use /// Over /** */ for doc blocks.
2014-09-17Case-insensitive environment keys.Vadim Chugunov-7/+75
2014-09-16Fallout from renamingAaron Turon-69/+75
2014-09-16Use PATH instead of HOME in env! exampleBrian Anderson-2/+2
HOME does not exist under typical windows environments.
2014-09-16Align with _mut conventionsAaron Turon-5/+17
As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. [breaking-change]
2014-09-16Rename std::io::net::unix to std::io::net::pipe.Jonas Hietala-5/+4
Renamed as we may support pipes for other platforms. Closes #12093 [breaking-change]
2014-09-14inlines contains in bitflags!Felix Raimundo-0/+1
Closes #17210
2014-09-13librustc: Forbid inherent implementations that aren't adjacent to thePatrick Walton-14/+28
type they provide an implementation for. This breaks code like: mod foo { struct Foo { ... } } impl foo::Foo { ... } Change this code to: mod foo { struct Foo { ... } impl Foo { ... } } Additionally, if you used the I/O path extension methods `stat`, `lstat`, `exists`, `is_file`, or `is_dir`, note that these methods have been moved to the the `std::io::fs::PathExtensions` trait. This breaks code like: fn is_it_there() -> bool { Path::new("/foo/bar/baz").exists() } Change this code to: use std::io::fs::PathExtensions; fn is_it_there() -> bool { Path::new("/foo/bar/baz").exists() } Closes #17059. RFC #155. [breaking-change]
2014-09-08auto merge of #16952 : alexcrichton/rust/windows-large-console-write, r=brsonbors-1/+8
I've found that 64k is still too much and continue to see the errors as reported in #14940. I've locally found that 32k fails, and 24k succeeds, so I've trimmed the size down to 10000 which the included links in the added comment end up recommending. It sounds like the limit can still be hit with many threads in play, but I have yet to reproduce this, so I figure we can wait until that's hit (if it's possible) and then take action.
2014-09-08std: Turn down the stdout chunk sizeAlex Crichton-1/+8
I've found that 64k is still too much and continue to see the errors as reported in #14940. I've locally found that 32k fails, and 24k succeeds, so I've trimmed the size down to 8192 which libuv happens to use as well. It sounds like the limit can still be hit with many threads in play, but I have yet to reproduce this, so I figure we can wait until that's hit (if it's possible) and then take action.
2014-09-07Register snapshots.Huon Wilson-16/+0
Closes #16880.
2014-09-06auto merge of #16907 : SimonSapin/rust/tempdir-result, r=huonwbors-9/+13
This allows using `try!()` [breaking-change] Fixes #16875
2014-09-05auto merge of #16628 : pczarn/rust/hashmap-opt, r=nikomatsakisbors-3105/+3774
This is #15720, rebased and reopened. cc @nikomatsakis
2014-09-05auto merge of #16843 : bkoropoff/rust/reader-writer-box, r=alexcrichtonbors-0/+16
Cargo needs this to be able to instantiate `TerminfoTerminal<Box<Writer+'a>>` for 'a other than 'static.
2014-09-04std: Fix overflow of HashMap's capacityPiotr Czarnecki-32/+49
2014-09-04std: Refine and document HashMap's codePiotr Czarnecki-482/+704
* branchless `bucket.next()` * robin_hood is a free function * fixed the resize policy that was off by one * documented the growth algorithm * updated documentation after interface changes * removed old fixmes
2014-09-04auto merge of #16986 : bjz/rust/bitflags, r=alexcrichtonbors-117/+136
Closes #16469
2014-09-04auto merge of #16982 : jbcrail/rust/comment-and-string-corrections, ↵bors-7/+7
r=alexcrichton I corrected spelling and capitalization errors in comments and strings.
2014-09-05Use {} for bitflags! definition and invocationsBrendan Zabarauskas-27/+27
This looks nicer because it reflects Rust's other syntactic structures.
2014-09-05Attach documentation to the bitflags! macro itselfBrendan Zabarauskas-97/+98
This is in consistent with the style demonstrated in the std::macros module.
2014-09-05Test attributesBrendan Zabarauskas-0/+8
2014-09-05Allow trailing commas in bitflags! macroBrendan Zabarauskas-4/+14
2014-09-04auto merge of #16923 : wickerwaka/rust/crate-as-fixup, r=alexcrichtonbors-4/+4
Changed occurances of: extern crate foo = "bar"; to: extern crate "bar" as foo; Added warning for old deprecated syntax
2014-09-04Center alignment for fmtwickerwaka-1/+2
Use '^' to specify center alignment in format strings. fmt!( "[{:^5s}]", "Hi" ) -> "[ Hi ]" fmt!( "[{:^5s}]", "H" ) -> "[ H ]" fmt!( "[{:^5d}]", 1i ) -> "[ 1 ]" fmt!( "[{:^5d}]", -1i ) -> "[ -1 ]" fmt!( "[{:^6d}]", 1i ) -> "[ 1 ]" fmt!( "[{:^6d}]", -1i ) -> "[ -1 ]" If the padding is odd then the padding on the right will be one character longer than the padding on the left. Tuples squashed
2014-09-04auto merge of #16976 : treeman/rust/issue-16943, r=kballardbors-2/+23
Closes #16943.
2014-09-04Print file permissions with 4 digits.Jonas Hietala-10/+10
2014-09-03Fix spelling errors and capitalization.Joseph Crail-7/+7
2014-09-03Print file permissions in octal form.Jonas Hietala-2/+23
Closes #16943.
2014-09-03Remove cross-borrowing for traits.Nick Cameron-2/+2
Closes #15349 [breaking-change] Trait objects are no longer implicitly coerced from Box<T> to &T. You must make an explicit coercion using `&*`.
2014-09-02std: Split hashmap.rs into modulesPiotr Czarnecki-1660/+1743
2014-09-02std: RawTable exposes a safe interface for HashMapPiotr Czarnecki-528/+883
Introduced a new growth algorithm.
2014-09-02std: branchless bucket distance for hashmapPiotr Czarnecki-9/+1
2014-09-01Updated to new extern crate syntax.wickerwaka-4/+4
Added warning for old deprecated syntax
2014-08-31Have std::io::TempDir::new and new_in return IoResultSimon Sapin-9/+13
This allows using `try!()` [breaking-change] Fixes #16875
2014-08-30auto merge of #16859 : alexcrichton/rust/snapshots, r=huonwbors-165/+0
2014-08-29Register new snapshotsAlex Crichton-165/+0
2014-08-30Unify non-snake-case lints and non-uppercase statics lintsP1start-6/+6
This unifies the `non_snake_case_functions` and `uppercase_variables` lints into one lint, `non_snake_case`. It also now checks for non-snake-case modules. This also extends the non-camel-case types lint to check type parameters, and merges the `non_uppercase_pattern_statics` lint into the `non_uppercase_statics` lint. Because the `uppercase_variables` lint is now part of the `non_snake_case` lint, all non-snake-case variables that start with lowercase characters (such as `fooBar`) will now trigger the `non_snake_case` lint. New code should be updated to use the new `non_snake_case` lint instead of the previous `non_snake_case_functions` and `uppercase_variables` lints. All use of the `non_uppercase_pattern_statics` should be replaced with the `non_uppercase_statics` lint. Any code that previously contained non-snake-case module or variable names should be updated to use snake case names or disable the `non_snake_case` lint. Any code with non-camel-case type parameters should be changed to use camel case or disable the `non_camel_case_types` lint. [breaking-change]
2014-08-29Relax lifetime bounds on Reader/Writer impls for trait boxesBrian Koropoff-0/+16
Cargo needs this to be able to instantiate `TerminfoTerminal<Box<Writer+'a>>` for 'a other than 'static.
2014-08-28auto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichtonbors-4/+4
Per API meeting https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md # Changes to `core::option` Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues. However, a few methods have been deprecated, either due to lack of use or redundancy: * `take_unwrap`, `get_ref` and `get_mut_ref` (redundant, and we prefer for this functionality to go through an explicit .unwrap) * `filtered` and `while` * `mutate` and `mutate_or_set` * `collect`: this functionality is being moved to a new `FromIterator` impl. # Changes to `core::result` Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues. * `collect`: this functionality is being moved to a new `FromIterator` impl. * `fold_` is deprecated due to lack of use * Several methods found in `core::option` are added here, including `iter`, `as_slice`, and variants. Due to deprecations, this is a: [breaking-change]
2014-08-28auto merge of #16626 : ruud-v-a/rust/duration-reform, r=brsonbors-279/+200
This changes the internal representation of `Duration` from days: i32, secs: i32, nanos: u32 to secs: i64, nanos: i32 This resolves #16466. Note that `nanos` is an `i32` and not `u32` as suggested, because `i32` is easier to deal with, and it is not exposed anyway. Some methods now take `i64` instead of `i32` due to the increased range. Some methods, like `num_milliseconds`, now return an `Option<i64>` instead of `i64`, because the range of `Duration` is now larger than e.g. 2^63 milliseconds. A few remarks: - Negating `MIN` is impossible. I chose to return `MAX` as `-MIN`, but it is one nanosecond less than the actual negation. Is this the desired behaviour? - In `std::io::timer`, some functions accept a `Duration`, which is internally converted into a number of milliseconds. However, the range of `Duration` is now larger than 2^64 milliseconds. There is already a FIXME in the file that this should be addressed (without a ticket number though). I chose to silently use 0 ms if the duration is too long. Is that right, as long as the backend still uses milliseconds? - Negative durations are not formatted correctly, but they were not formatted correctly before either.
2014-08-28libstd: Wrap duration.rs at 100 characters.Ruud van Asseldonk-3/+6
2014-08-28Fallout from stabilizing core::optionAaron Turon-4/+4
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-13/+152
2014-08-26auto merge of #16742 : vhbit/rust/ios-ffi-fix, r=alexcrichtonbors-0/+1
2014-08-26DST coercions and DST structsNick Cameron-78/+100
[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.