about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2020-05-05Fix exampleDolpheyn-1/+1
2020-05-05Fix comment positionDolpheyn-1/+1
2020-05-05Rollup merge of #71845 - steveklabnik:add-const-examples, r=dtolnayDylan DPC-2/+318
Add const examples I only added them to `std::f32` to get feedback on this approach before adding the other constants. When looking at https://github.com/rust-lang/rust/pull/68952, I found the docs a little confusing. Unless you're intimately aware of what's going on here, I don't think it's super clear what is deprecated and what you're supposed to do instead. I think short examples really clarify what's meant here, so that's what I did.
2020-05-05Document From trait for Option implementationsDolpheyn-0/+39
2020-05-04Stabilize saturating_abs and saturating_negTobias Rapp-7/+4
Stabilizes the following signed integer functions with saturation mechanics: * saturating_abs() * saturating_neg() Closes #59983
2020-05-04Rollup merge of #71877 - steveklabnik:small-example-fix, r=Mark-SimulacrumDylan DPC-2/+2
Use f64 in f64 examples I believe that this is a copy/paste error; this example was using f32, but it's the docs for f64.
2020-05-04Fix typo.Laurence Tratt-2/+2
2020-05-04Use f64 in f64 examplesSteve Klabnik-2/+2
I believe that this is a copy/paste error; this example was using f32, but it's the docs for f64.
2020-05-04Add examples to int macrosSteve Klabnik-2/+24
2020-05-04f64 examplesSteve Klabnik-0/+147
2020-05-04correct -> intendedSteve Klabnik-14/+14
2020-05-04add some whitespaceSteve Klabnik-0/+7
2020-05-04Add examples for std::f32 constants.Steve Klabnik-0/+140
And also point people to use the associated constants of f32 instead.
2020-05-04Document that lifetimes do not currently appear in any::type_name()'s output.Laurence Tratt-1/+3
2020-05-04Rephrase the any::type_name docs a bit.Laurence Tratt-7/+7
This attempts to be a little clearer (including in terminology) about the lack of guarantees that any::type_name provides.
2020-05-03Update src/libcore/sync/atomic.rsSteven Fackler-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-05-03Try to fix doc links in new `char` methods.Eduardo Sánchez Muñoz-16/+13
2020-05-03Rollup merge of #71398 - ThinkChaos:feat_refcell_take, r=LukasKalbertodtDylan DPC-0/+25
Add `RefCell::take` Add `RefCell::take` to match `Cell` and `Option`. I also changed a couple of calls to `.replace` to `.take`. Tracking issue is #71395. This is my first contribution, please tell me if there's anything I could improve, thanks!
2020-05-03Make `std::char` functions and constants associated to `char`.Eduardo Sánchez Muñoz-2/+242
2020-05-03Tweak and stabilize AtomicN::fetch_updateSteven Fackler-14/+10
2020-05-03Mention `RefCell::take` can panic in docsThinkChaos-0/+4
2020-05-02slice::fill: take T by value.Bastian Kauschke-6/+7
2020-05-02de-promote Duration::from_secsRalf Jung-1/+0
2020-05-01Document unsafety for `*const T` and `*mut T`LeSeulArtichaut-4/+8
2020-04-30Rollup merge of #71597 - CohenArthur:refactor-unique-empty, r=shepmasterDylan DPC-2/+1
Rename Unique::empty() -> Unique::dangling() A `FIXME` comment in `src/libcore/ptr/unique.rs` suggested refactoring `Unique::empty()` to `Unique::dangling()` which this PR does.
2020-04-30Rollup merge of #71692 - dfreese:cfgdocs, r=kennytmDylan DPC-0/+4
Add clarification on std::cfg macro docs v. #[cfg] attribute The wording was discussed, to a limited degree in #71679. This tries to address some confusion I as well as someone else had independently when looking at this macro. Fixes #71679
2020-04-30Rollup merge of #71672 - lcnr:instrinsics-wow, r=Dylan-DPCDylan DPC-12/+86
document missing stable counterparts of intrinsics Notes the stable counterpart of each intrinsic in case one exists. Implements #34338 r? @Dylan-DPC
2020-04-30rename-unique: Rename Unique::empty() to Unique::dangling()cohenarthur-2/+1
rename-unique: Change calls and doc in raw_vec.rs rename-unique: Change empty() -> dangling() in const-ptr-unique-rpass.rs
2020-04-29Update src/libcore/macros/mod.rsDavid Freese-1/+1
Co-Authored-By: kennytm <kennytm@gmail.com>
2020-04-29Add clarification on std::cfg macro docs v. #[cfg] attributeDavid Freese-0/+4
The wording was discussed, to a limited degree in #71679. This tries to address some confusion I as well as someone else had independently when looking at this macro. Fixes #71679
2020-04-29Rollup merge of #71680 - nicholasbishop:bishop-fix-eq-link, r=Mark-SimulacrumDylan DPC-0/+1
Fix doc link to Eq trait from PartialEq trait The `Eq` link was incorrectly going to the `eq` method of `PartialEq` instead of to the `Eq` trait.
2020-04-29Rollup merge of #71507 - CohenArthur:document-unsafe-libcore-ptr, ↵Dylan DPC-7/+45
r=Mark-Simulacrum Document unsafety in core::ptr Contributes to #66219 I have yet to document all the `unsafe` blocks in the lib and would like to know if I'm headed in the right direction r? @steveklabnik
2020-04-29Fix doc link to Eq trait from PartialEq traitNicholas Bishop-0/+1
The `Eq` link was incorrectly going to the `eq` method of `PartialEq` instead of to the `Eq` trait.
2020-04-29document stable counterparts of intrinsicsBastian Kauschke-12/+86
2020-04-29safety-ptr: Add SAFETY on some unsafe blocks from libcore/ptrcohenarthur-3/+43
Add documentation example to slice_from_raw_parts_mut() Add SAFETY explanations to some unsafe blocks in libcore/ptr * libcore/ptr/mod.rs * libcore/ptr/unique.rs * libcore/ptr/non_null.rs safety-mod.rs: Add SAFETY to slice_from_raw_parts(), slice_from_raw_parts_mut() slice_from_raw_parts_mut: Add documentation example safety-ptr-unique.rs: Add SAFETY to new() and cast() safety-ptr-non_null.rs: Add SAFETY to new() safety-ptr-non_null.rs: Add SAFETY to cast() safety-ptr-non_null.rs: Add SAFETY to from() impls safety-ptr-unique.rs: Add SAFETY to from() impls safety-ptr-non_null.rs: Add SAFETY to new() safety-ptr-unique.rs: Add SAFETY to new() safety-ptr-mod.rs: Fix safety explanation https://github.com/rust-lang/rust/pull/71507#discussion_r414488884 safety-prt-non_null.rs: Fix SAFETY comment syntax safety-ptr-unique.rs: Fix syntax for empty() safety-ptr-non_null.rs: Fix misuse of non-null for align_of() safety-ptr-non_null.rs: Remove incorrect SAFETY comment safety-ptr-unique.rs: Remove unsound SAFETY comment safety-ptr-mod.rs: Add std comment on slice_from_raw_parts guarantee safety-ptr-unique.rs: Remove incorrect safety comment Creating a Unique from a NonNull has strict guarantees that the current implementation does not guarantee https://github.com/rust-lang/rust/pull/71507#discussion_r415035952 safety-ptr: Re-adding ignore-tidy directive
2020-04-27Update link to unstable book for llvm_asm macroZach Reizner-1/+1
2020-04-27clarify interaction of pin drop guarantee and panicsRalf Jung-2/+4
2020-04-27Rollup merge of #71589 - RalfJung:unique-no-shr, r=SimonSapinDylan DPC-17/+0
remove Unique::from for shared pointer types r? @SimonSapin
2020-04-26remove Unique::from for shared pointer typesRalf Jung-17/+0
2020-04-26Use min_specialization in liballocMatthew Jasper-0/+9
- Remove a type parameter from `[A]RcFromIter`. - Remove an implementation of `[A]RcFromIter` that didn't actually specialize anything. - Remove unused implementation of `IsZero` for `Option<&mut T>`. - Change specializations of `[A]RcEqIdent` to use a marker trait version of `Eq`. - Remove `BTreeClone`. I couldn't find a way to make this work with `min_specialization`. - Add `rustc_unsafe_specialization_marker` to `Copy` and `TrustedLen`.
2020-04-26Add `RefCell::take`ThinkChaos-0/+21
In the same vein as `Cell::take` and `Option::take`.
2020-04-26Fix since attribute for nonzero_bitor impl'sJonas Platte-5/+5
2020-04-25Auto merge of #71556 - Dylan-DPC:rollup-9ll4shr, r=Dylan-DPCbors-0/+87
Rollup of 7 pull requests Successful merges: - #69041 (proc_macro: Stabilize `Span::resolved_at` and `Span::located_at`) - #69813 (Implement BitOr and BitOrAssign for the NonZero integer types) - #70712 (stabilize BTreeMap::remove_entry) - #71168 (Deprecate `{Box,Rc,Arc}::into_raw_non_null`) - #71544 (Replace filter_map().next() calls with find_map()) - #71545 (Fix comment in docstring example for Error::kind) - #71548 (Add missing Send and Sync impls for linked list Cursor and CursorMut.) Failed merges: r? @ghost
2020-04-25Rollup merge of #69813 - thomcc:nonzero-bitor, r=AmanieuDylan DPC-0/+87
Implement BitOr and BitOrAssign for the NonZero integer types This provides overloaded operators for `NonZero$Int | NonZero$Int`, `NonZero$Int | $Int`, and `$Int | NonZero$Int`. It also provides `BitOrAssign` where `self` is `NonZero$Int`, for symmetry. It's a pretty small conceptual addition, but is good becasue but avoids a case where the operation is obviously sound, but you'd otherwise need unsafe to do it. In crates trying to minimize `unsafe` usage, this is unfortunate and makes working with `NonZero` types often not worth it, even if the operations you're doing are clearly sound. I've marked these as stable as I've been told in the past that trait impls are automatically stable. I'm happy to change it to unstable if this wasn't correct information. I'm not entirely confident what version I should have put down, so I followed https://www.whatrustisit.com. Hopefully it's correct for this. Apologies in advance if this has come up before, but I couldn't find it.
2020-04-25Auto merge of #71439 - Mark-Simulacrum:stage0-next, r=jonas-schievinkbors-150/+10
Bump bootstrap compiler This bumps the bootstrap compiler and the rustfmt that x.py fmt uses.
2020-04-25Bump rustfmt to most recently shippedMark Rousskov-2/+2
2020-04-25Bump bootstrap compilerMark Rousskov-150/+10
2020-04-25Rollup merge of #71480 - GuillaumeGomez:panic-info-example, r=Dylan-DPCDylan DPC-3/+9
Improve PanicInfo examples readability cc @Eijebong r? @Dylan-DPC
2020-04-24Rollup merge of #71476 - RalfJung:miri-test-sizes, r=kennytmDylan DPC-30/+16
more compact way to adjust test sizes for Miri Inspired by @dtolnay
2020-04-24Improve PanicInfo examples readabilityGuillaume Gomez-3/+9