about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2014-10-10auto merge of #17853 : alexcrichton/rust/issue-17718, r=pcwaltonbors-83/+83
This change is an implementation of [RFC 69][rfc] which adds a third kind of global to the language, `const`. This global is most similar to what the old `static` was, and if you're unsure about what to use then you should use a `const`. The semantics of these three kinds of globals are: * A `const` does not represent a memory location, but only a value. Constants are translated as rvalues, which means that their values are directly inlined at usage location (similar to a #define in C/C++). Constant values are, well, constant, and can not be modified. Any "modification" is actually a modification to a local value on the stack rather than the actual constant itself. Almost all values are allowed inside constants, whether they have interior mutability or not. There are a few minor restrictions listed in the RFC, but they should in general not come up too often. * A `static` now always represents a memory location (unconditionally). Any references to the same `static` are actually a reference to the same memory location. Only values whose types ascribe to `Sync` are allowed in a `static`. This restriction is in place because many threads may access a `static` concurrently. Lifting this restriction (and allowing unsafe access) is a future extension not implemented at this time. * A `static mut` continues to always represent a memory location. All references to a `static mut` continue to be `unsafe`. This is a large breaking change, and many programs will need to be updated accordingly. A summary of the breaking changes is: * Statics may no longer be used in patterns. Statics now always represent a memory location, which can sometimes be modified. To fix code, repurpose the matched-on-`static` to a `const`. static FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } change this code to: const FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } * Statics may no longer refer to other statics by value. Due to statics being able to change at runtime, allowing them to reference one another could possibly lead to confusing semantics. If you are in this situation, use a constant initializer instead. Note, however, that statics may reference other statics by address, however. * Statics may no longer be used in constant expressions, such as array lengths. This is due to the same restrictions as listed above. Use a `const` instead. [breaking-change] Closes #17718 [rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-09Use the same html_root_url for all docsBrian Anderson-1/+1
2014-10-09Revert "Update html_root_url for 0.12.0 release"Brian Anderson-1/+1
This reverts commit 2288f332301b9e22db2890df256322650a7f3445.
2014-10-09core: Convert statics to constantsAlex Crichton-83/+83
2014-10-09Merge tag '0.12.0'Brian Anderson-1/+1
0.12.0 release
2014-10-08auto merge of #17748 : mahkoh/rust/int_slice, r=aturonbors-0/+58
2014-10-08add {Imm,M}utableIntSliceJulian Orth-0/+58
2014-10-07Update html_root_url for 0.12.0 releaseBrian Anderson-1/+1
2014-10-07auto merge of #17807 : nick29581/rust/slice6, r=aturonbors-82/+188
r? @aturon
2014-10-07Reinstate AsSlice impls for Option and ResultNick Cameron-0/+37
2014-10-07Rename slicing methodsNick Cameron-9/+124
2014-10-07Rename slice::SliceNick Cameron-44/+6
2014-10-07Put slicing syntax behind a feature gate.Nick Cameron-4/+5
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-07Use slice syntax instead of slice_to, etc.Nick Cameron-60/+51
2014-10-06Remove core::any::AnyPrivateAaron Turon-7/+2
[Previously](https://github.com/rust-lang/rust/commit/e5da6a71a6a0b46dd3630fc8326e6d5906a1fde6), the `Any` trait was split into a private portion and an (empty) public portion, in order to hide the implementation strategy used for downcasting. However, the [new rules](https://github.com/rust-lang/rust/commit/e9ad12c0cae5c43ada6641c7dc840a0fbe5010a2) for privacy forbid `AnyPrivate` from actually being private. This patch thus reverts the introduction of `AnyPrivate`. Although this is unlikely to break any real code, it removes a public trait and is therefore a: [breaking-change]
2014-10-06auto merge of #17820 : pnkfelix/rust/fsk-improve-binary_search-doc2, ↵bors-2/+42
r=alexcrichton Add example to doc for `slice::ImmutableSlice::binary_search`. Fix #17817.
2014-10-06Add example to doc for `slice::ImmutableSlice::binary_search`.Felix S. Klock II-2/+42
Fix #17817.
2014-10-05auto merge of #16970 : kmcallister/rust/llvm-unreachable, r=thestingerbors-0/+7
I'm not sure how to add an automated test for this.
2014-10-04Add intrinsics::unreachableKeegan McAllister-0/+7
2014-10-04Make examples for AtomicInt refer to AtomicIntPeter Minten-6/+6
The examples for fetch_or, fetch_and and fetch_xor for std::sync::atomic::AtomicInt used AtomicUint instead of AtomicInt.
2014-10-02rollup merge of #17666 : eddyb/take-garbage-outAlex Crichton-10/+1
Conflicts: src/libcollections/lib.rs src/libcore/lib.rs src/librustdoc/lib.rs src/librustrt/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/test/run-pass/issue-8898.rs
2014-10-02rollup merge of #16993 : dschatzberg/items-boundsAlex Crichton-2/+2
2014-10-02Revert "Use slice syntax instead of slice_to, etc."Aaron Turon-65/+107
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
2014-10-02Revert "Remove the `_` suffix from slice methods."Aaron Turon-99/+79
This reverts commit df2f1fa7680a86ba228f004e7de731e91a1df1fe.
2014-10-02Revert "Put slicing syntax behind a feature gate."Aaron Turon-7/+6
This reverts commit 95cfc35607ccf5f02f02de56a35a9ef50fa23a82.
2014-10-02Revert "Review and rebasing changes"Aaron Turon-64/+28
This reverts commit 6e0611a48707a1f5d90aee32a02b2b15957ef25b.
2014-10-02Add lifetime bounds on Items and MutItems.Dan Schatzberg-2/+2
This also requires a fix for Vec's MoveItems. This resolves issue #16941
2014-10-02syntax: mark the managed_boxes feature as Removed.Eduard Burtescu-1/+1
2014-10-02core: remove raw::GcBox.Eduard Burtescu-9/+0
2014-10-02Review and rebasing changesNick Cameron-28/+64
2014-10-02Put slicing syntax behind a feature gate.Nick Cameron-6/+7
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-02Remove the `_` suffix from slice methods.Nick Cameron-79/+99
Deprecates slicing methods from ImmutableSlice/MutableSlice in favour of slicing syntax or the methods in Slice/SliceMut. Closes #17273.
2014-10-02Use slice syntax instead of slice_to, etc.Nick Cameron-107/+65
2014-10-01auto merge of #17132 : reem/rust/any-static-bound, r=alexcrichtonbors-3/+3
This bound is already implicit through the AnyPrivate trait, but since it is not explicit, you still have to write Box<Any + 'static>, even though Any can only be 'static. Introducing the 'static bound here makes this bound explicit, making Box<Any> legal.
2014-09-30Bound Any with 'staticJonathan Reem-3/+3
This bound is already implicit through the AnyPrivate trait, but since it is not explicit, you still have to write Box<Any + 'static>, even though Any can only be 'static. Introducing the 'static bound here makes this bound explicit, making Box<Any> legal.
2014-09-30librustc: Forbid `..` in range patterns.Patrick Walton-20/+20
This breaks code that looks like: match foo { 1..3 => { ... } } Instead, write: match foo { 1...3 => { ... } } Closes #17295. [breaking-change]
2014-09-29rollup merge of #17621 : sfackler/new-snapAlex Crichton-27/+0
2014-09-29rollup merge of #17602 : Tobba/defailbloat-staticAlex Crichton-9/+8
2014-09-29rollup merge of #17585 : sfackler/string-sliceAlex Crichton-0/+23
2014-09-29rollup merge of #17582 : kmcallister/gc-boxAlex Crichton-4/+4
2014-09-29rollup merge of #17564 : japaric/fix-slicemut-docsAlex Crichton-4/+4
2014-09-29rollup merge of #17557 : sfackler/fuse-exampleAlex Crichton-1/+3
2014-09-28Register new snapshotsSteven Fackler-23/+0
2014-09-28Defailbloat fail!(&'static str)Tobba-9/+8
2014-09-26Implement Slice for String and strSteven Fackler-0/+23
Closes #17502
2014-09-27auto merge of #17469 : sfackler/rust/into-result, r=aturonbors-1/+44
This is the inverse of `Result::ok` and helps to bridge `Option` and `Result` based APIs.
2014-09-26Rename raw::Box to raw::GcBoxKeegan McAllister-4/+4
Fixes #17470.
2014-09-26Fix `SliceMut` documentationJorge Aparicio-4/+4
The syntax sugar is `[mut from..to]` not `[from..to]`
2014-09-26Add Option::{ok_or, ok_or_else}Steven Fackler-1/+44
These are the inverses of `Result::ok` and help to bridge `Option` and `Result` based APIs.
2014-09-25Fix Iterator::fuse exampleSteven Fackler-1/+3
The for loop would *always* exaust the iterator previously, which seems like behavior that was not intended. It's still kind of a weird function.