about summary refs log tree commit diff
path: root/src/liballoc/rc.rs
AgeCommit message (Collapse)AuthorLines
2015-05-13RebasingNick Cameron-4/+0
2015-05-13Fix a bunch of bugsNick Cameron-2/+4
* segfault due to not copying drop flag when coercing * fat pointer casts * segfault due to not checking drop flag properly * debuginfo for DST smart pointers * unreachable code in drop glue
2015-05-13Make Rc DST-compatibleNick Cameron-7/+382
2015-05-13eddyb's changes for DST coercionsNick Cameron-2/+2
+ lots of rebasing
2015-04-28Register new snapshotsTamir Duberstein-2/+0
2015-04-22Remove doc-comment default::Default importsCorey Farwell-1/+0
In 8f5b5f94dcdb9884737dfbc8efd893d1d70f0b14, `default::Default` was added to the prelude, so these imports are no longer necessary.
2015-04-07alloc: impl fmt::Pointer for Rc, Arc and BoxRicho Healey-0/+7
Closes #24091
2015-04-04Removed explicit lifetimes for `get_mut`. Fixed the doc test.Dzmitry Malyshau-1/+1
2015-03-27rollup merge of #23743: Adenilson/addInfoArcClone01Alex Crichton-1/+2
Adding more information about the behavior of Arc/Rc when you perform a clone() call.
2015-03-26Adding more information about the behavior of Arc/RcAdenilson Cavalcanti-1/+2
when you perform a clone() call.
2015-03-26Switch drop-flag to `u8` to allow special tags to instrument state.Felix S. Klock II-3/+3
Refactored code so that the drop-flag values for initialized (`DTOR_NEEDED`) versus dropped (`DTOR_DONE`) are given explicit names. Add `mem::dropped()` (which with `DTOR_DONE == 0` is semantically the same as `mem::zeroed`, but the point is that it abstracts away from the particular choice of value for `DTOR_DONE`). Filling-drop needs to use something other than `ptr::read_and_zero`, so I added such a function: `ptr::read_and_drop`. But, libraries should not use it if they can otherwise avoid it. Fixes to tests to accommodate filling-drop.
2015-03-23Test fixes and rebase conflicts, round 2Alex Crichton-40/+50
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+12
2015-03-18Register new snapshotsAlex Crichton-3/+0
2015-03-16impl<T> *const T, impl<T> *mut TJorge Aparicio-0/+3
2015-03-11Example -> ExamplesSteve Klabnik-2/+2
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-03Add `: Box<_>` or `::Box<_>` type annotations to various places.Felix S. Klock II-1/+2
This is the kind of change that one is expected to need to make to accommodate overloaded-`box`. ---- Note that this is not *all* of the changes necessary to accommodate Issue 22181. It is merely the subset of those cases where there was already a let-binding in place that made it easy to add the necesasry type ascription. (For unnamed intermediate `Box` values, one must go down a different route; `Box::new` is the option that maximizes portability, but has potential inefficiency depending on whether the call is inlined.) ---- There is one place worth note, `run-pass/coerce-match.rs`, where I used an ugly form of `Box<_>` type ascription where I would have preferred to use `Box::new` to accommodate overloaded-`box`. I deliberately did not use `Box::new` here, because that is already done in coerce-match-calls.rs. ---- Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-23import boxed for alloc/rc.rs (fixup #22696)Manish Goregaokar-1/+3
2015-02-23Use boxed functions instead of transmuteStepan Koltsov-2/+3
... to convert between Box and raw pointers. E. g. use ``` let b: Box<Foo> = Box::from_raw(p); ``` instead of ``` let b: Box<Foo> = mem::transmute(p); ``` Patch also changes closure release code in `src/libstd/sys/unix/thread.rs` when `pthread_create` failed. Raw pointer was transmuted to box of `FnOnce()` instead of `Thunk`. This code was probably never executed, because `pthread_create` rarely fails in practice.
2015-02-20Register new snapshotsAlex Crichton-8/+0
2015-02-18rollup merge of #22210: aturon/stab-final-borrowAlex Crichton-7/+0
Conflicts: src/libcollections/btree/map.rs src/libcollections/str.rs src/libcollections/vec.rs src/libcore/borrow.rs src/libcore/hash/mod.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs
2015-02-18Stabilize std::borrowAaron Turon-7/+0
This commit stabilizes `std::borrow`, making the following modifications to catch up the API with language changes: * It renames `BorrowFrom` to `Borrow`, as was originally intended (but blocked for technical reasons), and reorders the parameters accordingly. * It moves the type parameter of `ToOwned` to an associated type. This is somewhat less flexible, in that each borrowed type must have a unique owned type, but leads to a significant simplification for `Cow`. Flexibility can be regained by using newtyped slices, which is advisable for other reasons anyway. * It removes the owned type parameter from `Cow`, making the type much less verbose. * Deprecates the `is_owned` and `is_borrowed` predicates in favor of direct matching. The above API changes are relatively minor; the basic functionality remains the same, and essentially the whole module is now marked `#[stable]`. [breaking-change]
2015-02-18std: Stabilize the `hash` moduleAlex Crichton-2/+10
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-17Register new snapshotsAlex Crichton-6/+2
2015-02-17Rc itself isn't immutable.Artem-1/+1
An "immutable reference-counted pointer" is confusing, one might think that the `Rc` itself is immutable which isn't the case.
2015-02-09int/uint => isize/usize in liblibc/liballoc/libarenawe-9/+9
2015-02-07Fix broken link to std::rc module docsCaspar Krieger-2/+2
Current link structure is /std/rc/struct.Rc.html so ../index.html ends up linking to /std/ rather than /std/rc/
2015-02-06Rollup merge of #21954 - jbcrail:fix-misspelled-comments, r=steveklabnikManish Goregaokar-2/+2
The spelling corrections were made in both documentation comments and regular comments.
2015-02-04Fix for misspelled comments.Joseph Crail-2/+2
The spelling corrections were made in both documentation comments and regular comments.
2015-02-03Rc: Add assumptions that the pointer is non-nullJames Miller-2/+25
Since the snapshot compiler is still using an older LLVM version, omit the call in stage0, because compile times explode otherwise.
2015-02-01More deprecating of i/u suffixes in librariesAlfie John-21/+21
2015-01-30Remove all `i` suffixesTobias Bucher-33/+33
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-165/+8
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-23grandfathered -> rust1Brian Anderson-16/+16
2015-01-23Set unstable feature names appropriatelyBrian Anderson-14/+14
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-14/+14
2015-01-21Minor fixesBrian Anderson-2/+0
2015-01-21Tie stability attributes to feature gatesBrian Anderson-1/+0
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-30/+36
2015-01-21Revert "Use assume to inform the optimiser about refcount invariants"Alex Crichton-13/+2
This reverts commit a729a404945de10f99e2530a5c28952996532b29.
2015-01-21Revert "Add assumptions that the pointer is non-null"Alex Crichton-16/+2
This reverts commit 9bbfd681c9fa47f462a89e8f5eedd3fa2a5de2e7.
2015-01-21Revert "Add more explanation for why the assumes are there"Alex Crichton-9/+1
This reverts commit a7525bc4c8eb8507a5c248d29286e77133217cf3.
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-8/+8
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rollup merge of #21437: FlaPer87/snapshotAlex Crichton-154/+0
r? @alexcrichton
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-8/+8
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-20Register snapshot for 9006c3cFlavio Percoco-154/+0
2015-01-21Add more explanation for why the assumes are thereJames Miller-1/+9
2015-01-21Add assumptions that the pointer is non-nullJames Miller-2/+16
2015-01-21Use assume to inform the optimiser about refcount invariantsJames Miller-2/+13
The reference count can never be 0, unless we're about to drop the data completely. Using the `assume` intrinsic allows us to inform LLVM about that invariant, meaning it can avoid unnecessary drops.
2015-01-17Register new snapshots.Eduard Burtescu-8/+0