about summary refs log tree commit diff
path: root/src/libcore/ptr.rs
AgeCommit message (Collapse)AuthorLines
2016-04-17Improve as_mut ptr method exampleGuillaume Gomez-0/+3
2016-04-17Rollup merge of #32956 - GuillaumeGomez:ptr_examples, r=steveklabnikManish Goregaokar-0/+52
Add examples for std::ptr module functions Part of #29371. r? @steveklabnik
2016-04-14Add examples for std::ptr module functionsggomez-0/+52
2016-04-11std: Stabilize APIs for the 1.9 releaseAlex Crichton-27/+37
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-06avoid "==" in assert! when one of the values is a boolTshepang Lekhonkhobe-2/+2
2016-03-28Add doc examples on pointer typesGuillaume Gomez-0/+85
2016-03-20libcore: add Debug implementations to most missing typesSean McArthur-0/+2
2016-03-04End stdlib module summaries with a full stop.Steve Klabnik-1/+1
Fixes #9447
2016-03-01Rollup merge of #31965 - miqid:doc, r=steveklabnikSteve Klabnik-1/+1
Hello. Quite a few of the links in the `core` module concerning redirection to additional primitive type documentation are broken. I noticed in #30214 that there seemed to be a consensus with linking across to `std` module documentation from the `core` module. This is what I've done with the `core` modules for primitive types. If the changes here are good to go forward with, I'll happily tend to adding more documentation links for the extension traits in the aforementioned issue if need be. r? @steveklabnik
2016-03-01Fix broken links for core primitivesMichael Huynh-1/+1
Redirects existing links for more details on primitive types in the `core` module to the ones that exist in the `std` module.
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-1/+1
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-02-18Implement read_volatile and write_volatileAmanieu d'Antras-0/+48
2016-02-14Remove incorrect documentationSteve Klabnik-2/+1
Fixes #31599
2016-02-06Document that Unique<T> and Shared<T> are non-nullUlrik Sverdrup-2/+10
2015-12-21Register new snapshotsAlex Crichton-22/+4
Lots of cruft to remove!
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+1
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-2/+0
Remove `stable` stability annotations from inherent impls
2015-10-31Auto merge of #29480 - apasel422:coerce-unique, r=alexcrichtonbors-0/+4
Closes rust-lang/rfcs#1343.
2015-10-30Implement `CoerceUnsized` for `Unique`Andrew Paseltiner-0/+4
Closes rust-lang/rfcs#1343.
2015-10-30expose drop_in_place as ptr::drop_in_placeAlexis Beingessner-0/+2
2015-10-25Switch to 'const unsafe fn' ordering (rust-lang/rust#29107)John Hodge-1/+1
2015-10-21Auto merge of #29192 - phil-opp:unsafe-const-fns, r=alexcrichtonbors-4/+20
similar to #29085
2015-10-20Make Unique::new const functionPhilipp Oppermann-4/+20
2015-10-20Point core::ptr::Shared to tracking issue #27730.Huon Wilson-9/+9
2015-10-16Add `Shared` pointer and have `{Arc, Rc}` use itAndrew Paseltiner-2/+67
This change has two consequences: 1. It makes `Arc<T>` and `Rc<T>` covariant in `T`. 2. It causes the compiler to reject code that was unsound with respect to dropck. See compile-fail/issue-29106.rs for an example of code that no longer compiles. Because of this, this is a [breaking-change]. Fixes #29037. Fixes #29106.
2015-10-13Correct spelling in docsAndrew Paseltiner-2/+2
2015-10-11core: Update the safety docs for core::ptr::writeUlrik Sverdrup-3/+5
Updated to reflect that not dropping a value is safe (but discouraged).
2015-09-21Make function pointers implement traits for up to 12 parametersManish Goregaokar-0/+7
(12 was chosen to be consistent with what we do for tuples) Fixes #28559
2015-09-13Implement more traits for function pointersVadim Petrochenkov-27/+71
2015-09-04Rollup merge of #28188 - Manishearth:elide-core, r=alexcrichtonManish Goregaokar-1/+1
Makes things more greppable. This change was made automatically by clippy + bash scripts, though I will run test passes, please review carefully.
2015-09-03Elide lifetimes in libcoreManish Goregaokar-1/+1
2015-09-03Make `null()` and `null_mut()` const functionsVadim Petrochenkov-4/+4
2015-08-15core: Fill out issues for unstable featuresAlex Crichton-9/+14
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-21/+0
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-08-09Replace many uses of `mem::transmute` with more specific functionsTobias Bucher-7/+6
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.
2015-07-29std: Remove the curious inner moduleAlex Crichton-1/+1
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-0/+3
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-20std: Create separate docs for the primitivesBrian Anderson-74/+1
Having the primitive and module docs derived from the same source causes problems, primarily that they can't contain hyperlinks cross-referencing each other. This crates dedicated private modules in `std` to document the primitive types, then for all primitives that have a corresponding module, puts hyperlinks in moth the primitive docs and the module docs cross-linking each other. This should help clear up confusion when readers find themselves on the wrong page.
2015-07-20doc: Clean up primitive short descriptionsBrian Anderson-1/+1
This makes the primitive descriptions on the front page read properly as descriptions of types and not of the associated modules.
2015-06-26Use Box::into_raw rather than the deprecated boxed::into_raw in tests and ↵Ms2ger-6/+4
documentation.
2015-06-19add note for future type-system adventurersAlexis Beingessner-0/+5
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-1/+1
2015-06-17core: Split apart the global `core` featureAlex Crichton-13/+13
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-4/+4
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-04-29rollup merge of #24610: nagisa/offset-docsAlex Crichton-3/+4
2015-04-28Register new snapshotsTamir Duberstein-17/+0
2015-04-28Clarify offset rules a bitSimonas Kazlauskas-3/+4
2015-04-15Rollup merge of #24435 - killercup:patch-9, r=steveklabnikSteve Klabnik-3/+3
The link works on the `std/ptr/index.html` docs page, but not the `std/primitive.pointer.html` page. Instead of leaving it half-broken, it is removed. I tried fixing this in #24432, but @alexcrichton mentioned that this doc string was used in two places (with different base paths unfortunately). r? @alexcrichton
2015-04-14Remove Incorrect Link from std::ptr::null DocsPascal Hertleif-3/+3
The link works on the std::ptr docs page, but not the primitive.ptr.html page. Instead of leaving it half-broken, it is removed.
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-3/+3