summary refs log tree commit diff
path: root/src/libcore/ptr.rs
AgeCommit message (Collapse)AuthorLines
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-4/+2
This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-07thanks @eddybSteve Klabnik-1/+1
2017-01-07Improve safety warning on ptr::swapSteve Klabnik-1/+4
2016-12-12Implement RFC #1725Steven Fackler-0/+83
cc #37955
2016-11-04core::ptr: Specify issue for ptr_wrapping_offset featureUlrik Sverdrup-2/+2
2016-10-27core::ptr: Add .wrapping_offset() methodsUlrik Sverdrup-0/+80
.wrapping_offset() exposes the arith_offset intrinsic in the core module. This is the first step in making it possible to stabilize the interface later. `arith_offset` is a useful tool for developing iterators for two reasons: 1. `arith_offset` is used by the slice's iterator, the most important iterator in libcore, and it is natural that Rust users need the same power available to implement similar iterators. 2. It is a good way to implement raw pointer iterations with step greater than one. The name seems to fit the style of methods like "wrapping_add".
2016-10-01std: Correct stability attributes for some implementationsOliver Middleton-1/+1
These are displayed by rustdoc so should be correct.
2016-09-15Add std::ptr::eq, for referential equality of &T references.Simon Sapin-0/+34
Fixes https://github.com/rust-lang/rfcs/issues/1155
2016-08-25Auto merge of #35906 - jseyfried:local_prelude, r=eddybbors-4/+1
Use `#[prelude_import]` in `libcore` and `libstd` r? @eddyb
2016-08-24Use `#[prelude_import]` in `libcore`.Jeffrey Seyfried-4/+1
2016-08-24Remove drop flags from structs and enums implementing Drop.Eduard Burtescu-15/+0
2016-08-21replace `println!` statements with `assert!`ions in `std::ptr` examplesMatthew Piziak-4/+8
r? @steveklabnik
2016-07-17Implement traits for variadic function pointersVadim Petrochenkov-2/+11
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