summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-03-24Added `T:Send` bound to `Queue<T>` to avoid specialized `Drop` impl.Felix S. Klock II-1/+1
2015-03-24Added `T:Send` bound to `Packet<T>` to avoid specialized `Drop` impl.Felix S. Klock II-2/+2
2015-03-24added `T:Send` bound to `Mutex<T>` to avoid specialized Drop impl.Felix S. Klock II-1/+1
2015-03-24Added `W: Writer` bound to `BufferedWriter<W>` to avoid specialized `Drop` impl.Felix S. Klock II-9/+9
2015-03-24Added `T:Send` bound to `Queue<T>` to avoid specialized Drop impl.Felix S. Klock II-2/+2
2015-03-24Added `Write` bounds to avoid a specialized Drop impl for `BufWriter`.Felix S. Klock II-9/+9
2015-03-24Added `T:Send` bound to `sync::mpsc::Receiver` and `sync::mpsc::Sender`.Felix S. Klock II-17/+17
This was necessary to avoid specialized `Drop` impls for the two structs.
2015-03-24std: Update docs for removal of ReadExt, WriteExtUlrik Sverdrup-16/+16
2015-03-25Change lint names to pluralsNick Cameron-2/+2
2015-03-25Add trivial cast lints.Nick Cameron-3/+5
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-24std: Zero memory when calling `read_to_end()`Alex Crichton-30/+14
This commit alters the behavior of the `Read::read_to_end()` method to zero all memory instead of passing an uninitialized buffer to `read`. This change is motivated by the [discussion on the internals forum][discuss] where the conclusion has been that the standard library will not expose uninitialized memory. [discuss]: http://internals.rust-lang.org/t/uninitialized-memory/1652 Closes #20314
2015-03-24Add examples for std::asciiSteve Klabnik-4/+96
Also tweaked a few things.
2015-03-24Add Examples for FileSteve Klabnik-0/+74
This is pretty basic, but it's nice to have something.
2015-03-23Test fixes and rebase conflicts, round 3Alex Crichton-3/+1
2015-03-23Test fixes and rebase conflicts, round 2Alex Crichton-26/+26
2015-03-23rollup merge of #23503: alexcrichton/fix-ptr-docsAlex Crichton-2/+2
The method with which backwards compatibility was retained ended up leading to documentation that rustdoc didn't handle well and largely ended up confusing.
2015-03-23Test fixes and rebase conflicts, round 1Alex Crichton-1/+1
2015-03-23rollup merge of #23383: alexcrichton/fs-create-dir-allAlex Crichton-1/+1
Conflicts: src/libstd/fs/mod.rs
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-1/+284
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23rollup merge of #23648: steveklabnik/rollupAlex Crichton-8/+8
- Successful merges: #22954, #23119, #23509, #23561, #23590, #23607, #23608, #23618, #23622, #23639, #23641 - Failed merges: #23401
2015-03-23rollup merge of #23641: steveklabnik/gh23632Alex Crichton-5/+5
Fixes #23632
2015-03-23rollup merge of #23640: nagisa/thread-less-weakAlex Crichton-11/+8
This is more portable as far as linux is concerned.
2015-03-23rollup merge of #23637: apasel422/iterAlex Crichton-0/+25
2015-03-23rollup merge of #23634: WiSaGaN/bugfix/fix_dead_linkAlex Crichton-1/+1
2015-03-23rollup merge of #23633: tomjakubowski/rustdoc-array-primAlex Crichton-1/+18
Previously, impls for `[T; n]` were collected in the same place as impls for `[T]` and `&[T]`. This splits them out into their own primitive page in both core and std.
2015-03-23rollup merge of #23631: andersk/minstack-dlsymAlex Crichton-14/+26
Linking `__pthread_get_minstack`, even weakly, was causing Debian’s `dpkg-shlibdeps` to detect an unnecessarily strict versioned dependency on libc6. Closes #23628.
2015-03-23rollup merge of #23622: steveklabnik/gh23196Alex Crichton-0/+6
Fixes #23196
2015-03-23rollup merge of #23615: steveklabnik/gh23540Alex Crichton-2/+1
Closes #23540
2015-03-23rollup merge of #23608: nagisa/refine-cursor-docstringAlex Crichton-8/+5
r? @steveklabnik
2015-03-23rollup merge of #23607: mahkoh/cursorAlex Crichton-0/+1
Closes #23599 r? @alexcrichton
2015-03-23rollup merge of #23601: nikomatsakis/by-value-indexAlex Crichton-5/+112
This is a [breaking-change]. When indexing a generic map (hashmap, etc) using the `[]` operator, it is now necessary to borrow explicitly, so change `map[key]` to `map[&key]` (consistent with the `get` routine). However, indexing of string-valued maps with constant strings can now be written `map["abc"]`. r? @japaric cc @aturon @Gankro
2015-03-23rollup merge of #23579: Ms2ger/thread_local-unsafeAlex Crichton-5/+3
Conflicts: src/libstd/thread/local.rs
2015-03-23rollup merge of #23557: aturon/rfc-909Alex Crichton-91/+127
This commit implements [RFC 909](https://github.com/rust-lang/rfcs/pull/909): The `std::thread_local` module is now deprecated, and its contents are available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and `ScopedKey`. The macros remain exactly as they were, which means little if any code should break. Nevertheless, this is technically a: [breaking-change] Closes #23547
2015-03-23rollup merge of #23541: aturon/stab-errorAlex Crichton-7/+7
This small commit stabilizes the `Error` trait as-is, except that `Send` and `Debug` are added as constraints. The `Send` constraint is because most uses of `Error` will be for trait objects, and by default we would like these objects to be transferrable between threads. The `Debug` constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because types that implement `Display` should certainly implement `Debug` in any case. In the near future we expect to add `Any`-like downcasting features to `Error`, but this is waiting on some additional mechanisms (`Reflect`). It will be added before 1.0 via default methods. [breaking-change] r? @alexcrichton Closes #21790
2015-03-23rollup merge of #23538: aturon/conversionAlex Crichton-87/+314
Conflicts: src/librustc_back/rpath.rs
2015-03-23rollup merge of #23283: brson/rpathfixAlex Crichton-0/+3
Fix regression in -C rpath that causes failures with symlinks The new `relative_from` method no longer supports the case on unix where both paths are absolute, which `-C rpath` depended on. This version fixes the problem by copying the old path_relative_from function into the rpath module. Fixes #23140 After experimenting with the new `relative_from` function on `Path` I'm not sure what it's use case is. It no longer even figures out that the relative path from `/foo/bar` to `/foo/baz/qux` is `../baz/qux`.
2015-03-23Add generic conversion traitsAaron Turon-87/+314
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+283
2015-03-23Require feature attributes, and add them where necessaryBrian Anderson-1/+1
2015-03-23Rollup merge of #23641 - steveklabnik:gh23632, r=alexcrichtonSteve Klabnik-5/+5
Fixes #23632
2015-03-23Rollup merge of #23622 - steveklabnik:gh23196, r=alexcrichtonSteve Klabnik-0/+6
Fixes #23196
2015-03-23Rollup merge of #23608 - nagisa:refine-cursor-docstring, r=steveklabnikSteve Klabnik-8/+5
r? @steveklabnik
2015-03-23Rollup merge of #23607 - mahkoh:cursor, r=alexcrichtonSteve Klabnik-0/+1
Closes #23599 r? @alexcrichton
2015-03-23Rollup merge of #23509 - aturon:stab-entry, r=GankroSteve Klabnik-8/+8
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions. r? @Gankro
2015-03-23rustdoc: Support for "array" primitiveTom Jakubowski-1/+18
Impls on `clean::Type::FixedVector` are now collected in the array primitive page instead of the slice primitive page. Also add a primitive docs for arrays to `std`.
2015-03-23Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses ofNiko Matsakis-1/+1
`[]` on maps to `get` in rustc, since stage0 and stage1+ disagree about how to use `[]`.
2015-03-23Adjust Index/IndexMut impls. For generic collections, we takeNiko Matsakis-4/+111
references. For collections whose keys are integers, we take both references and by-value.
2015-03-23Implement RFC 909: move thread_local into threadAaron Turon-91/+127
This commit implements [RFC 909](https://github.com/rust-lang/rfcs/pull/909): The `std::thread_local` module is now deprecated, and its contents are available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and `ScopedKey`. The macros remain exactly as they were, which means little if any code should break. Nevertheless, this is technically a: [breaking-change] Closes #23547
2015-03-23Stabilize the Error traitAaron Turon-7/+7
This small commit stabilizes the `Error` trait as-is, except that `Send` and `Debug` are added as constraints. The `Send` constraint is because most uses of `Error` will be for trait objects, and by default we would like these objects to be transferrable between threads. The `Debug` constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because types that implement `Display` should certainly implement `Debug` in any case. In the near future we expect to add `Any`-like downcasting features to `Error`, but this is waiting on some additional mechanisms (`Reflect`). It will be added before 1.0 via default methods. [breaking-change]
2015-03-23prctl instead of pthread on linux for name setupSimonas Kazlauskas-11/+8
This is more portable as far as linux is concerned.