about summary refs log tree commit diff
path: root/src/liballoc/rc.rs
AgeCommit message (Collapse)AuthorLines
2017-06-16Introduce tidy lint to check for inconsistent tracking issuesest31-2/+2
This commit * Refactors the collect_lib_features function to work in a non-checking mode (no bad pointer needed, and list of lang features). * Introduces checking whether unstable/stable tags for a given feature have inconsistent tracking issues. * Fixes such inconsistencies throughout the codebase.
2017-06-05Use single quotes, and doc the Rc struct itself.Ulysse Carion-3/+4
2017-06-03Explicate what "Rc" and "Arc" stand for.Ulysse Carion-1/+2
2017-05-22Update Rc and Arc documentation.Nicolas Silva-15/+33
It was decided in the RFC discussion https://github.com/rust-lang/rfcs/pull/1954 to make the function call syntax Rc::clone(&foo) the idiomatic way to clone a reference counted pointer (over the method call syntax foo.clone(). This change updates the documentation of Rc, Arc and their respoective Weak pointers to reflect it and bring more exposure to the existence of the function call syntax.
2017-05-04fallout from NonZero/Unique/Shared changesAlexis Beingessner-28/+22
2017-04-23Auto merge of #41437 - cuviper:remove-unstable-deprecated, r=alexcrichtonbors-18/+1
Remove items that are unstable and deprecated This removes unstable items that have been deprecated for more than one cycle. - Since 1.16.0, `#![feature(enumset)]` - All of `mod collections::enum_set` - Since 1.15.0, `#![feature(borrow_state)]` - `cell::BorrowState` - `RefCell::borrow_state()` - Since 1.15.0, `#![feature(is_unique)]` - `Rc::is_unique()` (made private like `Arc::is_unique()`) - Since 1.15.0, `#![feature(rc_would_unwrap)]` - `Rc::would_wrap()` - Since 1.13.0, `#![feature(binary_heap_extras)]` - `BinaryHeap::push_pop()` - `BinaryHeap::replace()` - Since 1.12.0, `#![feature(as_unsafe_cell)]` - `Cell::as_unsafe_cell()` - `RefCell::as_unsafe_cell()` - Since 1.12.0, `#![feature(map_entry_recover_keys)]` - `btree_map::OccupiedEntry::remove_pair()` - `hash_map::OccupiedEntry::remove_pair()` - Since 1.11.0, `#![feature(float_extras)]` - `Float::nan()` - `Float::infinity()` - `Float::neg_infinity()` - `Float::neg_zero()` - `Float::zero()` - `Float::one()` - `Float::integer_decode()` - `f32::integer_decode()` - `f32::ldexp()` - `f32::frexp()` - `f32::next_after()` - `f64::integer_decode()` - `f64::ldexp()` - `f64::frexp()` - `f64::next_after()` - Since 1.11.0, `#![feature(zero_one)]` - `num::Zero` - `num::One`
2017-04-22cache attributes of items from foreign cratesAriel Ben-Yehuda-2/+33
this avoids parsing item attributes on each call to `item_attrs`, which takes off 33% (!) of translation time and 50% (!) of trans-item collection time.
2017-04-20Privatize Rc::is_uniqueJosh Stone-5/+1
[unstable, deprecated since 1.15.0]
2017-04-20Remove Rc::would_wrapJosh Stone-13/+0
[unstable, deprecated since 1.15.0]
2017-04-12Updating docs for std::rc::Rcprojektir-33/+33
2017-03-20Fix up various linkssteveklabnik-1/+1
The unstable book, libstd, libcore, and liballoc all needed some adjustment.
2017-03-17Stabilize rc_raw feature, closes #37197Aaron Turon-13/+9
2017-03-17Stabilize ptr_eq feature, closes #36497Aaron Turon-5/+1
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-2/+2
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-02-20Revert "Fix up links"Steve Klabnik-1/+1
This reverts commit 7f1d1c6d9a7be5e427bace30e740b16b25f25c92. The original commit was created because mdBook and rustdoc had different generation algorithms for header links; now with https://github.com/rust-lang/rust/pull/39966 , the algorithms are the same. So let's undo this change. ... when I came across this problem, I said "eh, this isn't fun, but it doesn't take that long." I probably should have just actually taken the time to fix upstream, given that they were amenable. Oh well!
2017-02-13Fix up linksSteve Klabnik-1/+1
mdbook and rustdoc generate links differently, so we need to change all these links.
2017-01-31In std:rc, clarify the lack of mutability inside an RcFederico Mena Quintero-3/+6
Also, point to the example in Cell's docs for how to do it.
2016-12-28Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_dangle]`Andrew Paseltiner-2/+1
CC #34761
2016-12-16Address falloutAaron Turon-31/+2
2016-12-15Stabilize:Aaron Turon-8/+5
- `std::rc::Rc::{strong_count, weak_count}` - `std::sync::Arc::{strong_count, weak_count}` Deprecate: - `std::rc::Rc::{would_unwrap, is_unique}`
2016-12-05Add missing links to Rc docGuillaume Gomez-43/+45
2016-11-08Auto merge of #37192 - cristicbz:rust-rc-into-raw, r=brsonbors-0/+79
Add `{into,from}_raw` to Rc and Arc These methods convert to and from a `*const T` for `Rc` and `Arc` similar to the way they work on `Box`. The only slight complication is that `from_raw` needs to offset the pointer back to find the beginning of the `RcBox`/`ArcInner`. I felt this is a fairly small addition, filling in a gap (when compared to `Box`) so it wouldn't need an RFC. The motivation is primarily for FFI. (I'll create an issue and update a PR with the issue number if reviewers agree with the change in principle **Edit: done #37197**) ~~Edit: This was initially `{into,from}_raw` but concerns were raised about the possible footgun if mixed with the methods of the same name of `Box`.~~ Edit: This was went from `{into,from}_raw` to `{into,from}_inner_raw` then back to `{into,from}_raw` during review.
2016-11-05Add `{into,from}_raw` to Rc and ArcCristi Cobzarenco-0/+79
2016-10-13Add assert checking that allocation and deallocation sizes are equalVadim Petrochenkov-3/+4
2016-10-13Add an unstable constructor for creating `Rc<str>` from `str`Vadim Petrochenkov-1/+26
2016-10-04Apply some Arc doc changes to RcKeegan McAllister-11/+21
2016-09-28Remove stage0 hacksBrian Anderson-2/+0
2016-09-21Tweak std::rc docsKeegan McAllister-160/+310
Fixes #29372.
2016-09-15Add `pub fn ptr_eq(this: &Self, other: &Self) -> bool` to `Rc` and `Arc`.Simon Sapin-0/+37
Servo and Kuchiki have had helper functions doing this for some time.
2016-09-11Documentation of what does for each typeathulappadan-0/+1
2016-08-27Doc: explain why Box/Rc/Arc methods do not take selfGeorg Brandl-0/+6
This can be confusing for newcomers, especially due to the argument name "this".
2016-08-24Remove drop flags from structs and enums implementing Drop.Eduard Burtescu-22/+16
2016-08-21add example for `Rc::would_unwrap`Matthew Piziak-0/+17
Part of #29372 r? @steveklabnik
2016-07-08Rollup merge of #34097 - arbitrary-cat:master, r=steveklabnikManish Goregaokar-1/+2
Revise wording in Rc documentation. The term "thread-local" has a widely accepted meaning which is not the meaning it's used for here.
2016-07-07Changed wording per aturon's comments.Sam Payson-1/+2
2016-06-05Update rc.rsFrank McSherry-1/+1
The original description suggests that the original `Rc<T>` itself is downgraded, which doesn't seem to be what the code does. At the same time, `Rc` is one of those types that can do weird things with only a shared reference, so I thought it would be good to be clear.
2016-06-05Revise wording in Rc documentation.Sam Payson-1/+1
The term "thread-local" has a widely-accepted meaning which is not the meaning it's used for here.
2016-05-28rustfmt liballoc folderSrinivas Reddy Thatiparthy-4/+4
2016-05-24std: Stabilize APIs for the 1.10 releaseAlex Crichton-28/+31
This commit applies the FCP decisions made by the libs team for the 1.10 cycle, including both new stabilizations and deprecations. Specifically, the list of APIs is: Stabilized: * `os::windows::fs::OpenOptionsExt::access_mode` * `os::windows::fs::OpenOptionsExt::share_mode` * `os::windows::fs::OpenOptionsExt::custom_flags` * `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::unix::fs::OpenOptionsExt::custom_flags` * `sync::Weak::new` * `Default for sync::Weak` * `panic::set_hook` * `panic::take_hook` * `panic::PanicInfo` * `panic::PanicInfo::payload` * `panic::PanicInfo::location` * `panic::Location` * `panic::Location::file` * `panic::Location::line` * `ffi::CStr::from_bytes_with_nul` * `ffi::CStr::from_bytes_with_nul_unchecked` * `ffi::FromBytesWithNulError` * `fs::Metadata::modified` * `fs::Metadata::accessed` * `fs::Metadata::created` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `SocketAddr::is_unnamed` * `SocketAddr::as_pathname` * `UnixStream::connect` * `UnixStream::pair` * `UnixStream::try_clone` * `UnixStream::local_addr` * `UnixStream::peer_addr` * `UnixStream::set_read_timeout` * `UnixStream::set_write_timeout` * `UnixStream::read_timeout` * `UnixStream::write_Timeout` * `UnixStream::set_nonblocking` * `UnixStream::take_error` * `UnixStream::shutdown` * Read/Write/RawFd impls for `UnixStream` * `UnixListener::bind` * `UnixListener::accept` * `UnixListener::try_clone` * `UnixListener::local_addr` * `UnixListener::set_nonblocking` * `UnixListener::take_error` * `UnixListener::incoming` * RawFd impls for `UnixListener` * `UnixDatagram::bind` * `UnixDatagram::unbound` * `UnixDatagram::pair` * `UnixDatagram::connect` * `UnixDatagram::try_clone` * `UnixDatagram::local_addr` * `UnixDatagram::peer_addr` * `UnixDatagram::recv_from` * `UnixDatagram::recv` * `UnixDatagram::send_to` * `UnixDatagram::send` * `UnixDatagram::set_read_timeout` * `UnixDatagram::set_write_timeout` * `UnixDatagram::read_timeout` * `UnixDatagram::write_timeout` * `UnixDatagram::set_nonblocking` * `UnixDatagram::take_error` * `UnixDatagram::shutdown` * RawFd impls for `UnixDatagram` * `{BTree,Hash}Map::values_mut` * `<[_]>::binary_search_by_key` Deprecated: * `StaticCondvar` - this, and all other static synchronization primitives below, are usable today through the lazy-static crate on stable Rust today. Additionally, we'd like the non-static versions to be directly usable in a static context one day, so they're unlikely to be the final forms of the APIs in any case. * `CONDVAR_INIT` * `StaticMutex` * `MUTEX_INIT` * `StaticRwLock` * `RWLOCK_INIT` * `iter::Peekable::is_empty` Closes #27717 Closes #27720 cc #27784 (but encode methods still exist) Closes #30014 Closes #30425 Closes #30449 Closes #31190 Closes #31399 Closes #31767 Closes #32111 Closes #32281 Closes #32312 Closes #32551 Closes #33018
2016-04-05Remove strange names created by lack of privacy-conscious name lookupTobias Bucher-23/+19
The fixed issue that allowed this was #12808.
2016-03-10first round of removal of integer suffixessrinivasreddy-2/+2
2016-03-09Clarify that try_unwrap needs exactly oneSteve Klabnik-2/+3
Fixes #31950
2016-02-08Implement fmt::Pointer for pointers to unsized typesKamal Marhubi-1/+1
This allows printing pointers to unsized types with the {:p} formatting directive. The following impls are extended to unsized types: - impl<'a, T: ?Sized> Pointer for &'a T - impl<'a, T: ?Sized> Pointer for &'a mut T - impl<T: ?Sized> Pointer for *const T - impl<T: ?Sized> Pointer for *mut T - impl<T: ?Sized> fmt::Pointer for Box<T> - impl<T: ?Sized> fmt::Pointer for Rc<T> - impl<T: ?Sized> fmt::Pointer for Arc<T>
2016-01-20Fix incorrect stability annotations for WeakSebastian Hahn-4/+4
This was accidentally introduced in 7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2.
2015-12-31Auto merge of #30593 - steveklabnik:small_rc_refactoring, r=Gankrobors-4/+6
This hairy conditional doesn't need to be so. It _does_ need to be a thin pointer, otherwise, it will fail to compile, so let's pull that out into a temporary for future readers of the source. /cc @nrc @SimonSapin @Gankro @durka , who brought this up on IRC
2015-12-30Auto merge of #30467 - shahn:master, r=brsonbors-1/+38
This adds a constructor for a Weak that can never be upgraded. These are mostly useless, but for example are required when deserializing.
2015-12-30Small refactoring to make this code more clearSteve Klabnik-4/+6
This hairy conditional doesn't need to be so. It _does_ need to be a thin pointer, otherwise, it will fail to compile, so let's pull that out into a temporary for future readers of the source. Also, after a discussion with @pnkfelix and @gankro, we don't need these null checks anymore, as zero-on-drop has been gone for a while now.
2015-12-21Register new snapshotsAlex Crichton-6/+0
Lots of cruft to remove!
2015-12-19Address review commentsSebastian Hahn-2/+1
2015-12-19Rename Weak::new_downgraded to Weak::newSebastian Hahn-4/+4