about summary refs log tree commit diff
path: root/src/libstd/cell.rs
AgeCommit message (Collapse)AuthorLines
2014-05-07core: Inherit the cell moduleAlex Crichton-317/+0
2014-05-01Add debug_assert and debug_assert_eq macrosSteven Fackler-3/+3
I also switched some `assert!` calls over to `debug_assert!`. Closes #12049. RFC: 0015-assert
2014-04-10Stop using transmute_mut in RefCellSteven Fackler-21/+17
This is supposedly undefined behavior now that Unsafe exists, so we'll use Cell instead.
2014-04-03std: Remove `RefCell::set()`Erick Tryzelaar-10/+0
2014-04-03std: Remove `RefCell::get()`Erick Tryzelaar-16/+4
It's surprising that `RefCell::get()` is implicitly doing a clone on a value. This patch removes it and replaces all users with either `.borrow()` when we can autoderef, or `.borrow().clone()` when we cannot.
2014-04-01std: fix Cell's Show instance.Huon Wilson-2/+13
Previously it was printing the address of the Unsafe contained in the Cell (i.e. the address of the Cell itself). This is clearly useless, and was presumably a mistake due to writing `*&` instead of `&*`. However, this later expression is likely also incorrect, since it takes a reference into a Cell while other user code is executing (i.e. the Show instance for the contained type), hence the contents should just be copied out.
2014-03-31std: Switch field privacy as necessaryAlex Crichton-8/+8
2014-03-28Rename Pod into CopyFlavio Percoco-7/+7
Summary: So far, we've used the term POD "Plain Old Data" to refer to types that can be safely copied. However, this term is not consistent with the other built-in bounds that use verbs instead. This patch renames the Pod kind into Copy. RFC: 0003-opt-in-builtin-traits Test Plan: make check Reviewers: cmr Differential Revision: http://phabricator.octayn.net/D3
2014-03-22auto merge of #13076 : FlaPer87/rust/remove-freeze, r=alexcrichtonbors-10/+6
This PR removes the `Freeze` kind and the `NoFreeze` marker completely. Fixes #12577 cc @nikomatsakis r?
2014-03-22std: Remove the get() method from RefCell wrappersAlex Crichton-25/+4
This method has been entirely obsoleted by autoderef, so there's no reason for its existence.
2014-03-22cell: Remove Freeze / NoFreezeFlavio Percoco-10/+6
2014-03-20Clean up marker types and Unsafe initializationSteven Fackler-16/+12
2014-03-20Remove RefCell::{with, with_mut}Steven Fackler-59/+0
These are superfluous now that we have fixed rvalue lifetimes and Deref.
2014-03-20Make Cell and RefCell use Unsafe<T>Flavio Percoco-14/+15
2014-03-20Make `Rc`, `Cell` and `RefCell` NoShareFlavio Percoco-0/+4
2014-03-08Removed DeepClone. Issue #12698.Michael Darakananda-8/+1
2014-03-04Implement DerefImm for Rc and DerefImm/DerefMut for RefCell's Ref/RefMut.Eduard Burtescu-1/+22
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-2/+9
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-27Implement Eq for Cell<T>Bruno de Oliveira Abinader-0/+9
2014-02-07Cleaned up imports per coding standards.chromatic-2/+2
No functional changes; just style.
2014-02-07Removed prelude::* from libstd files.chromatic-1/+4
This replaces the imports from the prelude with the re-exported symbols.
2014-02-04Replace NonCopyable usage with NoPodFlavio Percoco-4/+3
cc #10834
2014-01-31Introduce marker types for indicating variance and for opting outNiko Matsakis-5/+17
of builtin bounds. Fixes #10834. Fixes #11385. cc #5922.
2014-01-06Register new snapshotsAlex Crichton-27/+0
2013-12-26libstd: Make a temporary separate `stage0` implementation for `Cell` toPatrick Walton-0/+27
avoid a crash in later stages
2013-12-18Register new snapshotsAlex Crichton-35/+0
Time for a visit from the snapshot fairy!
2013-12-16libstd: Implement the new `Cell`.Patrick Walton-0/+100
2013-12-15librustc: Remove identifiers named `box`, since it's about to become a keyword.Patrick Walton-8/+8
2013-12-15std: fix spelling in docs.Huon Wilson-2/+2
2013-12-10libstd: Remove `Cell` from the library.Patrick Walton-60/+0
2013-11-26std: Remove unused attributesklutzy-2/+0
This also enables two tests properly.
2013-11-23Move mutable::Mut to cell::RefCellSteven Fackler-4/+298
2013-11-22Strip down Cell functionalitySteven Fackler-59/+3
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-2/+2
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-2/+2
Who doesn't like a massive renaming?
2013-09-30std: Remove usage of fmt!Alex Crichton-2/+2
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-1/+1
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-23auto merge of #8677 : bblum/rust/scratch, r=alexcrichtonbors-0/+6
r anybody; there isn't anything complicated here
2013-08-22Enabled unit tests in std and extra.Vadim Chugunov-2/+0
2013-08-21Don't fail in port.try_recv() the second time. Close #7800.Ben Blum-0/+6
2013-08-12Make cell with_ref/with_mut_ref use finally. Close #7975.Ben Blum-8/+8
2013-07-22new snapshotDaniel Micay-1/+0
2013-07-20Use Option .take() or .take_unwrap() instead of util::replace where possibleblake2-ppc-2/+1
2013-06-29Rename #[mutable] to #[no_freeze]Brian Anderson-1/+2
2013-06-04std::cell: Modernize constructorsPhilipp Brüschweiler-14/+14
Part of #3853
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-8/+10
2013-05-30Remove unnecessary 'use' formsDaniel Farina-2/+1
Fix a laundry list of warnings involving unused imports that glutted up compilation output. There are more, but there seems to be some false positives (where 'remedy' appears to break the build), but this particular set of fixes seems safe.
2013-05-30Require documentation by default for libstdAlex Crichton-0/+2
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+1
2013-05-24use deriving for DeepCloneDaniel Micay-14/+1