about summary refs log tree commit diff
path: root/src/libcore/default.rs
AgeCommit message (Collapse)AuthorLines
2016-05-23Move all `Default` docs from module to traitCarol (Nichols || Goulding)-73/+42
I had already copied the implementation example in a previous commit; this copies the explanation and usage examples to the general trait description.
2016-05-23Shorten, yet clarify, initial summary sentencesCarol (Nichols || Goulding)-1/+3
2016-05-23Make the Default docs more like the other traitsCarol (Nichols || Goulding)-3/+26
Add explicit "Derivable" and "How can I implement `Default`" sections. Copied relevant sections from the module-level documentation, but also linked to there-- it has a more comprehensive narrative with examples that show implementation AND use. Decided to just put implementation example in the trait documentation.
2015-11-12libcore: deny warnings in doctestsKevin Butler-0/+6
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-1/+0
Remove `stable` stability annotations from inherent impls
2015-10-23Make `{Default, From, FromIterator, One, Zero}` well-formedAndrew Paseltiner-1/+3
Using these traits in an object context previously resulted in an RFC 1214 warning.
2015-08-26doc: I had to read this twice before understanding itTshepang Lekhonkhobe-1/+1
2015-04-22Remove doc-comment default::Default importsCorey Farwell-9/+0
In 8f5b5f94dcdb9884737dfbc8efd893d1d70f0b14, `default::Default` was added to the prelude, so these imports are no longer necessary.
2015-03-15Strip all leading/trailing newlinesTamir Duberstein-1/+0
2015-02-18Audit `core::default` for `int`/`uint` usage.Felix S. Klock II-8/+8
* Use `i32` (`u32`) in doc examples, not `int` (`u32`). * Switch impl macros to use `isize`/`usize` rather than `int`/`uint`.
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-10/+10
Conflicts: src/libcore/cmp.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/result.rs src/libcore/str/mod.rs src/librustc/lint/builtin.rs src/librustc/lint/context.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/poison.rs
2015-01-25Moving away from deprecated i/u suffixes in libcoreAlfie John-10/+10
2015-01-23grandfathered -> rust1Brian Anderson-5/+5
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-5/+5
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-5/+5
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-17/+18
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-15std: Second pass stabilization of `default`Alex Crichton-0/+4
This commit performs a second pass stabilization of the `std::default` module. The module was already marked `#[stable]`, and the inheritance of `#[stable]` was removed since this attribute was applied. This commit adds the `#[stable]` attribute to the trait definition and one method name, along with all implementations found in the standard distribution.
2014-11-17Switch to purely namespaced enumsSteven Fackler-2/+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-09-24Beef up Default documentationSteve Klabnik-3/+108
2014-07-20auto merge of #15806 : treeman/rust/std-doc, r=alexcrichtonbors-0/+10
Used `HashMap` and `HashSet` as the base of most examples. Could change it up with different containers, but I don't think it's a big deal.
2014-07-19Document some trait methods.Jonas Hietala-0/+10
2014-07-18std: Stabilize defaultBrian Anderson-0/+2
All stable.
2014-06-11rustc: Update how Gc<T> is recognizedAlex Crichton-4/+0
This commit uses the same trick as ~/Box to map Gc<T> to @T internally inside the compiler. This moves a number of implementations of traits to the `gc` module in the standard library. This removes functions such as `Gc::new`, `Gc::borrow`, and `Gc::ptr_eq` in favor of the more modern equivalents, `box(GC)`, `Deref`, and pointer equality. The Gc pointer itself should be much more useful now, and subsequent commits will move the compiler away from @T towards Gc<T> [breaking-change]
2014-05-28Move trait impls for primitives near trait definitionPiotr Jawniak-4/+27
Closes #12925
2014-05-15core: Remove the unit moduleBrian Anderson-0/+5
2014-05-13std: Move the owned module from core to stdAlex Crichton-6/+0
The compiler was updated to recognize that implementations for ty_uniq(..) are allowed if the Box lang item is located in the current crate. This enforces the idea that libcore cannot allocated, and moves all related trait implementations from libcore to libstd. This is a breaking change in that the AnyOwnExt trait has moved from the any module to the owned module. Any previous users of std::any::AnyOwnExt should now use std::owned::AnyOwnExt instead. This was done because the trait is intended for Box traits and only Box traits. [breaking-change]
2014-05-07core: Inherit the default moduleAlex Crichton-0/+27