about summary refs log tree commit diff
path: root/src/libcore/cell.rs
AgeCommit message (Collapse)AuthorLines
2017-02-11Add `swap` method for `Cell`Charlie Fan-0/+27
2017-02-01Update cell docsWesley Wiser-5/+13
2017-01-26Move stability attributes per feedbackWesley Wiser-2/+3
2017-01-24Extend Cell to work with non-Copy typesWesley Wiser-36/+94
Part of #39264
2016-12-16Address falloutAaron Turon-0/+2
2016-12-15Deprecate std::cell::RefCell::borrow_stateAaron Turon-0/+2
2016-12-15Stabilize std::cell::Ref::cloneAaron Turon-3/+1
2016-10-03std: Stabilize and deprecate APIs for 1.13Alex Crichton-25/+21
This commit is intended to be backported to the 1.13 branch, and works with the following APIs: Stabilized * `i32::checked_abs` * `i32::wrapping_abs` * `i32::overflowing_abs` * `RefCell::try_borrow` * `RefCell::try_borrow_mut` * `DefaultHasher` * `DefaultHasher::new` * `DefaultHasher::default` Deprecated * `BinaryHeap::push_pop` * `BinaryHeap::replace` * `SipHash13` * `SipHash24` * `SipHasher` - use `DefaultHasher` instead in the `std::collections::hash_map` module Closes #28147 Closes #34767 Closes #35057 Closes #35070
2016-09-11Documentation of what does for each typeathulappadan-0/+3
2016-08-30Rollup merge of #35895 - F001:patch-1, r=steveklabnikGuillaume Gomez-10/+39
Fix documentation in cell mod The implementation of Rc type in this doc is outdated.
2016-08-26Fix documentation in cell modchangchun.fan-10/+39
2016-08-24Use `#[prelude_import]` in `libcore`.Jeffrey Seyfried-10/+3
2016-08-23Auto merge of #35627 - apasel422:coerce-cell, r=alexcrichtonbors-0/+16
Implement `CoerceUnsized` for `{Cell, RefCell, UnsafeCell}` These impls are analogous to the one for `NonZero`. It's occasionally useful to be able to coerce the cell types when they're being used inside another abstraction. See Manishearth/rust-gc#17 for an example. r? @eddyb
2016-08-19std: Stabilize APIs for the 1.12 releaseAlex Crichton-0/+36
Stabilized * `Cell::as_ptr` * `RefCell::as_ptr` * `IpAddr::is_{unspecified,loopback,multicast}` * `Ipv6Addr::octets` * `LinkedList::contains` * `VecDeque::contains` * `ExitStatusExt::from_raw` - both on Unix and Windows * `Receiver::recv_timeout` * `RecvTimeoutError` * `BinaryHeap::peek_mut` * `PeekMut` * `iter::Product` * `iter::Sum` * `OccupiedEntry::remove_entry` * `VacantEntry::into_key` Deprecated * `Cell::as_unsafe_cell` * `RefCell::as_unsafe_cell` * `OccupiedEntry::remove_pair` Closes #27708 cc #27709 Closes #32313 Closes #32630 Closes #32713 Closes #34029 Closes #34392 Closes #34285 Closes #34529
2016-08-14Implement `CoerceUnsized` for `{Cell, RefCell, UnsafeCell}`Andrew Paseltiner-0/+16
2016-08-14Rollup merge of #35392 - malbarbo:cell-from, r=brsonEduard-Mihai Burtescu-0/+22
Implement From for Cell, RefCell and UnsafeCell Considering that `From` is implemented for `Box`, `Rc` and `Arc`, it seems [reasonable](https://internals.rust-lang.org/t/implementing-from-t-for-other-std-types/3744) to implement it for `Cell`, `RefCell` and `UnsafeCell`.
2016-08-08Implement `RefCell::{try_borrow, try_borrow_mut}`Andrew Paseltiner-9/+116
2016-08-05Implement From for Cell, RefCell and UnsafeCellMarco A L Barbosa-0/+22
2016-07-26Clarify UnsafeCell docs; fix #34496Manish Goregaokar-0/+19
2016-07-11Add missing examples for std::cell typesGuillaume Gomez-0/+49
2016-07-03std: Stabilize APIs for the 1.11.0 releaseAlex Crichton-2/+2
Although the set of APIs being stabilized this release is relatively small, the trains keep going! Listed below are the APIs in the standard library which have either transitioned from unstable to stable or those from unstable to deprecated. Stable * `BTreeMap::{append, split_off}` * `BTreeSet::{append, split_off}` * `Cell::get_mut` * `RefCell::get_mut` * `BinaryHeap::append` * `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past libstd stabilizations * `Iterator::sum` * `Iterator::product` Deprecated * `{f32, f64}::next_after` * `{f32, f64}::integer_decode` * `{f32, f64}::ldexp` * `{f32, f64}::frexp` * `num::One` * `num::Zero` Added APIs (all unstable) * `iter::Sum` * `iter::Product` * `iter::Step` - a few methods were added to accomodate deprecation of One/Zero Removed APIs * `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is unstable Closes #27739 Closes #27752 Closes #32526 Closes #33444 Closes #34152 cc #34529 (new tracking issue)
2016-06-01Auto merge of #33853 - alexcrichton:remove-deprecated, r=aturonbors-75/+0
std: Clean out old unstable + deprecated APIs These should all have been deprecated for at least one cycle, so this commit cleans them all out.
2016-05-30std: Clean out old unstable + deprecated APIsAlex Crichton-75/+0
These should all have been deprecated for at least one cycle, so this commit cleans them all out.
2016-05-30Prevent the borrow counter from overflowing in `Ref::clone`Tobias Bucher-1/+3
Fixes #33880.
2016-05-12Auto merge of #33306 - vadixidav:master, r=alexcrichtonbors-1/+73
add implementation of Ord for Cell<T> and RefCell<T> where T: Ord Raised this in issue #33305.
2016-05-06Add `get_mut` methods to the `RefCell` and `Cell`Tobias Bucher-0/+24
This is safe since the borrow checker ensures that we have the only mutable reference to the struct, thus we can safely borrow its interior. Tracking issue is #33444.
2016-05-01change unstable to stable on traits and set version properlyGeordon Worley-4/+4
2016-05-01fix implementation of Ord for Cell<T> and RefCell<T> where T: OrdGeordon Worley-1/+73
2016-04-15Auto merge of #32785 - tbu-:pr_more_defaults, r=alexcrichtonbors-0/+7
Implement `Default` for more types in the standard library Also add `Hash` to `std::cmp::Ordering` and most possible traits to `fmt::Error`.
2016-04-15Implement `Default` for more types in the standard libraryTobias Bucher-0/+7
Also add `Hash` to `std::cmp::Ordering` and most possible traits to `fmt::Error`.
2016-04-05Remove strange names created by lack of privacy-conscious name lookupTobias Bucher-39/+35
The fixed issue that allowed this was #12808.
2016-04-02Rollup merge of #32652 - VFLashM:refcell_ref_coercion, r=alexcrichtonManish Goregaokar-2/+8
Added missing refcell ref/refmut coercions to unsized Ref/RefMut should be coercible to unsized. This commit adds a unit test and two missing CoerceUnsized implementations.
2016-03-31added missing refcell ref/refmut coercions to unsizedВалерий Лашманов-2/+8
2016-03-28Remove `unsafe` qualifier from `RefCell::as_unsafe_cell`Tobias Bucher-6/+2
This method is no longer unsafe because the field of `UnsafeCell` is no longer public.
2016-03-07Fix some line lengthsSimon Sapin-2/+4
2016-03-07"can be built on Ref::map"… how?Simon Sapin-2/+2
Now that `std::cell::Ref::filter_map` and `RefMut::filter_map` are deprecated, using them gives a warning like: ``` script/dom/element.rs:754:9: 754:24 warning: use of deprecated item: can be built on Ref::map, #[warn(deprecated)] on by default ``` But it’s not at all obvious *how* the functionality can be built on `Ref::map`. This PR adds to the warning message a crates.io URL for a crate that does.
2016-03-01Explicitly opt out of `Sync` for `cell` and `mpsc` typesAndrew Paseltiner-0/+6
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others.
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-7/+4
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-01-25RefCell::borrow_mut example should demonstrate mutCorey Farwell-1/+3
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+1
2015-11-12libcore: deny warnings in doctestsKevin Butler-0/+3
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-2/+0
Remove `stable` stability annotations from inherent impls
2015-10-23Unsafety -> Safety in doc headingsSteve Klabnik-2/+2
Follow https://doc.rust-lang.org/book/documentation.html#special-sections
2015-10-21Remove obsolete note about `UnsafeCell`'s fieldsAndrew Paseltiner-5/+1
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-2/+2
2015-09-03Elide lifetimes in libcoreManish Goregaokar-7/+7
2015-08-15core: Fill out issues for unstable featuresAlex Crichton-9/+14
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-27/+1
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-07-27Show appropriate feature flags in docsSteve Klabnik-2/+4
2015-07-17Remove confusing 'mutability root' termSteve Klabnik-7/+7
And some other outdated language. @echochamber came asking about these docs on IRC today, and they're a bit weird. I've updated them to be less ambiguous and use contemporary terminology.