kennytm
c3241b504f
Rollup merge of #46517 - notriddle:patch-2, r=BurntSushi
...
Stablize RefCell::{replace, swap}
RefCell::replace_with is not stablized in this PR, since it wasn't part of the RFC.
CC #43570
2017-12-20 21:21:51 +08:00
Ariel Ben-Yehuda
66c032cb2d
more comments
2017-12-06 00:51:47 +02:00
Ariel Ben-Yehuda
37df5e0b91
adjust libcore
2017-12-06 00:34:02 +02:00
Michael Howell
19775f73a3
Update cell.rs
2017-12-05 13:15:35 -07:00
Michael Howell
28a19bfa7f
Move replace_with to its own feature flag
...
I'm not allowed to have the same feature flag associated with multiple stability levels.
2017-12-05 12:03:57 -07:00
Michael Howell
fd064e041a
Stablize RefCell::{replace, swap}
...
RefCell::replace_with is not stablized in this PR, since it wasn't part of the RFC.
2017-12-05 09:07:12 -07:00
Simon Sapin
6c5f53e65e
Stabilize const-calling existing const-fns in std
...
Fixes #46038
2017-11-26 23:43:44 +01:00
Havvy
2d02772993
Add RefCell<T>::replace_with
2017-11-06 18:53:23 -08:00
Alex Crichton
ca18537197
Bump to 1.23 and update bootstrap
...
This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies
2017-10-26 13:59:18 -07:00
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