Commit graph

214 commits

Author SHA1 Message Date
Alex Burka
681e5da61e change #![feature(const_fn)] to specific gates 2017-09-16 15:53:02 +00:00
lukaramu
49ee9f3f08 Fix inconsistent doc headings
This fixes headings reading "Unsafety" and "Example", they should be
"Safety" and "Examples" according to RFC 1574.
2017-08-24 18:42:53 +02:00
Anthony Clays
fa346fc5d6
Fixed typo in RefCell::get_mut 2017-08-17 10:57:17 +02:00
bors
f1ca76c497 Auto merge of #43574 - notriddle:master, r=sfackler
Implement `RefCell::replace` and `RefCell::swap`

Tracking issue: #43570
2017-08-14 17:05:02 +00:00
Michael Howell
846d373ddf Clarify the language around RefCell::swap 2017-08-08 09:53:51 -07:00
Michael Howell
dc76247a0a Change "Example" to "Examples" in the doc comments 2017-08-02 10:58:27 -07:00
Michael Howell
03acea646c Implement RefCell::replace and RefCell::swap 2017-07-31 21:19:09 +00:00
Tymoteusz Jankowski
d429a4eac8 s/immutable/my_struct 2017-07-24 23:43:34 +02:00
Tymoteusz Jankowski
beb072a893 empty lines 2017-07-24 21:45:21 +02:00
Tymoteusz Jankowski
8286075346 ci fix? 2017-07-24 18:07:51 +02:00
Tymoteusz Jankowski
3c535952bc review fixes 2017-07-24 18:01:50 +02:00
Tymoteusz Jankowski
bb65d32568 add prose 2017-07-24 16:23:26 +02:00
Tymoteusz Jankowski
236b7487d5 Add simple docs example for struct Cell 2017-07-23 14:28:29 +02:00
Oliver Middleton
f2566bbaeb Correct some stability attributes
These show up in rustdoc so need to be correct.
2017-07-10 02:07:29 +01:00
Chris MacNaughton
14df54989a Ensure Guard types impl Display & Debug
Fixes #24372
2017-06-22 16:54:32 +02:00
Tshepang Lekhonkhobe
c288864ed0 doc: a more complete explanation, and a better example 2017-06-08 22:52:54 +02:00
Oliver Middleton
2f703e4304 Correct some stability versions
These were found by running tidy on stable versions of rust and finding
features stabilised with the wrong version numbers.
2017-05-20 08:38:39 +01:00
Alexis Beingessner
4ff583b116 fallout from NonZero/Unique/Shared changes 2017-05-04 23:54:54 -04:00
Guillaume Gomez
3ad844cfe2 Add more explanation on RefCell::get_mut 2017-04-24 15:08:39 +02:00
Josh Stone
313aab8fbe Remove RefCell::borrow_state
[unstable, deprecated since 1.15.0]
2017-04-20 21:16:31 -07:00
Josh Stone
cc605c895e Remove {Cell,RefCell}::as_unsafe_cell
[unstable, deprecated since 1.12.0]
2017-04-20 21:16:31 -07:00
Aaron Turon
33a5665988 Stabilize move_cell feature, closes #39264 2017-03-17 13:28:37 -07:00
Corey Farwell
3f95303db6 Rollup merge of #39793 - RalfJung:cell, r=alexcrichton
Allow more Cell methods for non-Copy types

Clearly, `get_mut` is safe for any `T`. The other two only provide unsafe pointers anyway.

The only remaining inherent method with `Copy` bound is `get`, which sounds about right to me.

I found the order if `impl` blocks in the file a little weird (first inherent impl, then some trait impls, then another inherent impl), but didn't change it to keep the diff small.

Contributes to #39264
2017-02-15 23:48:13 -05:00
Ralf Jung
044ed10fee Remove Copy bound from some Cell trait impls
Contributes to #39264
2017-02-14 09:46:06 +01:00
Ralf Jung
51a2e2fd82 Allow more Cell methods for non-Copy types
Contributes to #39264
2017-02-13 19:50:54 +01:00
Charlie Fan
a5e8bbf32b Add swap method for Cell 2017-02-11 13:08:13 +08:00
Wesley Wiser
daa509109f Update cell docs 2017-02-01 22:51:52 -05:00
Wesley Wiser
afac3ecacc Move stability attributes per feedback 2017-01-26 21:28:22 -05:00
Wesley Wiser
c6cfa3c489 Extend Cell to work with non-Copy types
Part of #39264
2017-01-24 22:48:38 -05:00
Aaron Turon
9a5cef4de5 Address fallout 2016-12-16 19:42:17 -08:00
Aaron Turon
dc2d5058e9 Deprecate std::cell::RefCell::borrow_state 2016-12-15 10:56:55 -08:00
Aaron Turon
b2882709b3 Stabilize std::cell::Ref::clone 2016-12-15 10:56:55 -08:00
Alex Crichton
10c3134da0 std: Stabilize and deprecate APIs for 1.13
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-10-03 10:34:34 -07:00
athulappadan
49e77dbf25 Documentation of what does for each type 2016-09-11 17:00:09 +05:30
Guillaume Gomez
325b7111c2 Rollup merge of #35895 - F001:patch-1, r=steveklabnik
Fix documentation in cell mod

The implementation of Rc type in this doc is outdated.
2016-08-30 10:39:06 +02:00
changchun.fan
f4c55dd08f Fix documentation in cell mod 2016-08-26 09:13:59 +08:00
Jeffrey Seyfried
e2ad3be178 Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
bors
43204fff5d Auto merge of #35627 - apasel422:coerce-cell, r=alexcrichton
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-23 04:16:28 -07:00
Alex Crichton
afeeadeae5 std: Stabilize APIs for the 1.12 release
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-19 11:59:56 -07:00
Andrew Paseltiner
1fd791ad62
Implement CoerceUnsized for {Cell, RefCell, UnsafeCell} 2016-08-14 22:04:01 -04:00
Eduard-Mihai Burtescu
fa57f358a3 Rollup merge of #35392 - malbarbo:cell-from, r=brson
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-14 20:29:47 +03:00
Andrew Paseltiner
a20a1db54a
Implement RefCell::{try_borrow, try_borrow_mut} 2016-08-08 23:59:56 -04:00
Marco A L Barbosa
1403df72c8 Implement From for Cell, RefCell and UnsafeCell 2016-08-05 16:57:19 -03:00
Manish Goregaokar
3873402805
Clarify UnsafeCell docs; fix #34496 2016-07-26 13:13:05 +05:30
Guillaume Gomez
76dd02025c Add missing examples for std::cell types 2016-07-11 17:13:36 +02:00
Alex Crichton
3016626c3a std: Stabilize APIs for the 1.11.0 release
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-07-03 10:49:01 -07:00
bors
728eea7dc1 Auto merge of #33853 - alexcrichton:remove-deprecated, r=aturon
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-06-01 15:11:38 -07:00
Alex Crichton
b64c9d5670 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-30 20:46:32 -07:00
Tobias Bucher
ef60c7cd49 Prevent the borrow counter from overflowing in Ref::clone
Fixes #33880.
2016-05-30 09:53:09 +02:00
bors
992bb1332f Auto merge of #33306 - vadixidav:master, r=alexcrichton
add implementation of Ord for Cell<T> and RefCell<T> where T: Ord

Raised this in issue #33305.
2016-05-12 00:18:15 -07:00