about summary refs log tree commit diff
path: root/src/libcore/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-11-15Rollup merge of #55785 - stjepang:unsized-drop-forget, r=alexcrichtonPietro Albini-0/+1
Add mem::forget_unsized() for forgetting unsized values ~~Allows passing values of `T: ?Sized` types to `mem::drop` and `mem::forget`.~~ Adds `mem::forget_unsized()` that accepts `T: ?Sized`. I had to revert the PR that removed the `forget` intrinsic and replaced it with `ManuallyDrop`: https://github.com/rust-lang/rust/pull/40559 We can't use `ManuallyDrop::new()` here because it needs `T: Sized` and we don't have support for unsized return values yet (will we ever?). r? @eddyb
2018-11-13Rollup merge of #55837 - Centril:spökdata-skall-vara-strukturellt-matchbar, ↵kennytm-0/+1
r=eddyb Make PhantomData #[structural_match] fixes https://github.com/rust-lang/rust/issues/55028 This makes `PhantomData<T>` structurally matchable, irrespective of whether `T` is, per the discussion on this week's language team meeting (the general consensus was that this was a bug-fix). All types containing `PhantomData<T>` and which used `#[derive(PartialEq, Eq)]` and were previously not `#[structural_match]` only because of `PhantomData<T>` will now be `#[structural_match]`. r? @nikomatsakis
2018-11-12Auto merge of #55278 - Centril:constification-1, r=alexcrichtonbors-1/+0
Minor standard library constification This PR makes some bits of the standard library into `const fn`s. I've tried to be as aggressive as I possibly could in the constification. The list is rather small due to how restrictive `const fn` is at the moment. r? @oli-obk cc @rust-lang/libs Stable public APIs affected: + [x] `Cell::as_ptr` + [x] `UnsafeCell::get` + [x] `char::is_ascii` + [x] `iter::empty` + [x] `ManuallyDrop::{new, into_inner}` + [x] `RangeInclusive::{start, end}` + [x] `NonNull::as_ptr` + [x] `{[T], str}::as_ptr` + [x] `Duration::{as_secs, subsec_millis, subsec_micros, subsec_nanos}` + [x] `CStr::as_ptr` + [x] `Ipv4Addr::is_unspecified` + [x] `Ipv6Addr::new` + [x] `Ipv6Addr::octets` Unstable public APIs affected: + [x] `Duration::{as_millis, as_micros, as_nanos, as_float_secs}` + [x] `Wrapping::{count_ones, count_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, reverse_bits, from_be, from_le, to_be, to_le, leading_zeros, is_positive, is_negative, leading_zeros}` + [x] `core::convert::identity` -------------------------- ## Removed from list in first pass: Stable public APIs affected: + [ ] `BTree{Map, Set}::{len, is_empty}` + [ ] `VecDeque::is_empty` + [ ] `String::{is_empty, len}` + [ ] `FromUtf8Error::utf8_error` + [ ] `Vec<T>::{is_empty, len}` + [ ] `Layout::size` + [ ] `DecodeUtf16Error::unpaired_surrogate` + [ ] `core::fmt::{fill, width, precision, sign_plus, sign_minus, alternate, sign_aware_zero_pad}` + [ ] `panic::Location::{file, line, column}` + [ ] `{ChunksExact, RChunksExact}::remainder` + [ ] `Utf8Error::valid_up_to` + [ ] `VacantEntry::key` + [ ] `NulError::nul_position` + [ ] `IntoStringError::utf8_error` + [ ] `IntoInnerError::error` + [ ] `io::Chain::get_ref` + [ ] `io::Take::{limit, get_ref}` + [ ] `SocketAddrV6::{flowinfo, scope_id}` + [ ] `PrefixComponent::{kind, as_os_str}` + [ ] `Path::{ancestors, display}` + [ ] `WaitTimeoutResult::timed_out` + [ ] `Receiver::{iter, try_iter}` + [ ] `thread::JoinHandle::thread` + [ ] `SystemTimeError::duration` Unstable public APIs affected: + [ ] `core::fmt::Arguments::new_v1` + [ ] `core::fmt::Arguments::new_v1_formatted` + [ ] `Pin::{get_ref, into_ref}` + [ ] `Utf8Lossy::chunks` + [ ] `LocalWaker::as_waker` + [ ] `panic::PanicInfo::{internal_constructor, message, location}` + [ ] `panic::Location::{internal_constructor }` ## Removed from list in 2nd pass: Stable public APIs affected: + [ ] `LinkedList::{new, iter, is_empty, len}` + [ ] `mem::forget` + [ ] `Cursor::{new, get_ref, position}` + [ ] `io::{empty, repeat, sink}` + [ ] `PoisonError::new` + [ ] `thread::Builder::new` + [ ] `process::Stdio::{piped, inherit, null}` Unstable public APIs affected: + [ ] `io::Initializer::{zeroing, should_initialize}`
2018-11-10Fix documentation typos.Bruce Mitchener-1/+1
2018-11-10make PhantomData #[structural_match].Mazdak Farrokhzad-0/+1
2018-11-10constify parts of libcore.Mazdak Farrokhzad-1/+0
2018-11-08Allow unsized types in mem::drop and mem::forgetStjepan Glavina-0/+1
2018-10-31Bump nightly to 1.32.0Alex Crichton-1/+0
* Also update the bootstrap compiler * Update cargo to 1.32.0 * Clean out stage0 annotations
2018-10-28Rollup merge of #55252 - SimonSapin:maybeuninit-new, r=blusskennytm-0/+1
Add MaybeUninit::new Sometimes it *is* initialized!
2018-10-21Add MaybeUninit::newSimon Sapin-0/+1
Sometimes it *is* initialized!
2018-10-19Stabilize impl_header_lifetime_elision in 2015Scott McMurray-1/+1
It's already stable in 2018; this finishes the stabilization.
2018-10-05Auto merge of #54017 - alexcrichton:wasm-atomics2, r=sfacklerbors-0/+1
std: Start implementing wasm32 atomics This commit is an initial start at implementing the standard library for wasm32-unknown-unknown with the experimental `atomics` feature enabled. None of these changes will be visible to users of the wasm32-unknown-unknown target because they all require recompiling the standard library. The hope with this is that we can get this support into the standard library and start iterating on it in-tree to enable experimentation. Currently there's a few components in this PR: * Atomic fences are disabled on wasm as there's no corresponding atomic op and it's not clear yet what the convention should be, but this will change in the future! * Implementations of `Mutex`, `Condvar`, and `RwLock` were all added based on the atomic intrinsics that wasm has. * The `ReentrantMutex` and thread-local-storage implementations panic currently as there's no great way to get a handle on the current thread's "id" yet. Right now the wasm32 target with atomics is unfortunately pretty unusable, requiring a lot of manual things here and there to actually get it operational. This will likely continue to evolve as the story for atomics and wasm unfolds, but we also need more LLVM support for some operations like custom `global` directives for this to work best.
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-0/+1
2018-09-30Auto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrumbors-1/+1
Bump to 1.31.0 and bootstrap from 1.30 beta Closes #54594.
2018-09-29Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"Ralf Jung-2/+0
This reverts commit c6e3d7fa3113aaa64602507f39d4627c427742ff, reversing changes made to 4591a245c7eec9f70d668982b1383cd2a6854af5.
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-24std: Start implementing wasm32 atomicsAlex Crichton-0/+1
This commit is an initial start at implementing the standard library for wasm32-unknown-unknown with the experimental `atomics` feature enabled. None of these changes will be visible to users of the wasm32-unknown-unknown target because they all require recompiling the standard library. The hope with this is that we can get this support into the standard library and start iterating on it in-tree to enable experimentation. Currently there's a few components in this PR: * Atomic fences are disabled on wasm as there's no corresponding atomic op and it's not clear yet what the convention should be, but this will change in the future! * Implementations of `Mutex`, `Condvar`, and `RwLock` were all added based on the atomic intrinsics that wasm has. * The `ReentrantMutex` and thread-local-storage implementations panic currently as there's no great way to get a handle on the current thread's "id" yet. Right now the wasm32 target with atomics is unfortunately pretty unusable, requiring a lot of manual things here and there to actually get it operational. This will likely continue to evolve as the story for atomics and wasm unfolds, but we also need more LLVM support for some operations like custom `global` directives for this to work best.
2018-09-22core: fix deprecated warningsJorge Aparicio-0/+2
2018-09-14Move std::os::raw::c_void into libcore and re-export in libstdIsaac Woods-0/+1
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-09-01rebaseTim-0/+7
2018-08-27Auto merge of #53227 - nivkner:pin_move, r=RalfJungbors-0/+1
move the Pin API into its own module for centralized documentation This implements the change proposed by @withoutboats in #49150, as suggested by @RalfJung in the review of #53104, along with the documentation that was originally in it, that was deemed more appropriate in module-level documentation. r? @RalfJung
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-23Stabilize 'attr_literals' feature.Sergio Benitez-1/+0
2018-08-23move PinMut into pin module and export through stdNiv Kaminer-0/+1
2018-08-15Make core::sync::atomic::Ordering #[non_exhaustive]varkor-0/+1
2018-08-09[nll] libcore: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-07Place unions, pointer casts and pointer derefs behind extra feature gatesOliver Schneider-0/+1
2018-08-05Remove unnecessary or invalid feature attributesvarkor-4/+0
2018-07-20Update stdsimd to undo an accidental stabilizationAlex Crichton-3/+0
Closes #52403
2018-07-06Remove unnecessary feature gate.Thayne McCombs-1/+0
To fix a warning.
2018-07-04Auto merge of #51395 - SimonSapin:repr-transparent, r=SimonSapinbors-0/+1
Add #[repr(transparent)] to some libcore types * `UnsafeCell` * `Cell` * `NonZero*` * `NonNull` * `Unique` CC https://github.com/rust-lang/rust/issues/43036
2018-07-01Rollup merge of #51511 - Centril:feature/stabilize_iterator_flatten, ↵Pietro Albini-1/+0
r=SimonSapin Stabilize Iterator::flatten in 1.29, fixes #48213. This PR stabilizes [`Iterator::flatten`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.flatten) in *version 1.29* (1.28 goes to beta in 10 days, I don't think there's enough time to land it in that time, but let's see...). Tracking issue is: #48213. cc @bluss re. itertools. r? @SimonSapin ping @pietroalbini -- let's do a crater run when this passes CI :)
2018-06-30Bootstrap from 1.28.0-beta.3Mark Simulacrum-1/+0
2018-06-16Add #[repr(transparent)] to some libcore typesSimon Sapin-0/+1
* `UnsafeCell` * `Cell` * `NonZero*` * `NonNull` * `Unique`
2018-06-12Stabilize #[repr(transparent)]Simon Sapin-1/+1
Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318 Reference PR: https://github.com/rust-lang-nursery/reference/pull/353
2018-06-11stabilize Iterator::flatten in 1.29, fixes #48115.Mazdak Farrokhzad-1/+0
2018-06-11Remove deprecated heap modulesSimon Sapin-7/+0
The heap.rs file was already unused.
2018-06-10Auto merge of #51200 - tmccombs:stable-iter-repeat-with, r=Centril,kennytmbors-1/+0
Stabilize iterator_repeat_with Fixes #48169
2018-06-06Auto merge of #51263 - cramertj:futures-in-core, r=aturonbors-0/+5
Add Future and task system to the standard library This adds preliminary versions of the `std::future` and `std::task` modules in order to unblock development of async/await (https://github.com/rust-lang/rust/issues/50547). These shouldn't be considered as final forms of these libraries-- design questions about the libraries should be left on https://github.com/rust-lang/rfcs/pull/2418. Once that RFC (or a successor) is merged, these APIs will be adjusted as necessary. r? @aturon
2018-06-06Add Future and task system to the standard libraryTaylor Cramer-0/+5
2018-06-03Rollup merge of #51299 - faern:const-int-ops, r=oli-obkMark Simulacrum-0/+1
const fn integer operations A follow up to #51171 Fixes #51267 Makes a lot of the integer methods (`swap_bytes`, `count_ones` etc) `const fn`s. See #51267 for a discussion about why this is wanted and the solution used.
2018-06-03s/panic_fmt/panic_impl/g in docsJorge Aparicio-1/+1
2018-06-02Stabilize iterator_repeat_withThayne McCombs-1/+0
Fixes #48169
2018-06-02Make most integer operations const fnsLinus Färnstrand-0/+1
2018-05-27lib.rs don't beautifuluuttff8-2/+2
2018-05-22Add Option::as_pin_mutTaylor Cramer-0/+1
2018-05-21Make `[T]::len` and `str::len` const fnOliver Schneider-0/+3
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-12/+7