about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
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-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-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-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-03Mention `RefCell::take` can panic in docsThinkChaos-0/+4
2020-05-02slice::fill: take T by value.Bastian Kauschke-6/+7
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-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-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
2020-04-24Rollup merge of #71492 - LeSeulArtichaut:document-unsafe-2, r=Mark-SimulacrumDylan DPC-16/+28
Document unsafety in core::{panicking, alloc::layout, hint, iter::adapters::zip} Helps with #66219. r? @Mark-Simulacrum do you want to continue reading safety comments? :D
2020-04-24Rollup merge of #71068 - pyfisch:unicode-version-stable, r=SimonSapinDylan DPC-4/+7
Stabilize UNICODE_VERSION (feature unicode_version) Tracking issue: #49726 r? @sfackler #71020 changed the definition of `UNICODE_VERSION` just yesterday from a struct to a tuple. Maybe you want to wait some more before stabilizing this constant, on the other hand this is a very small and simple addition. CC @behnam @SimonSapin @Serentty
2020-04-24Rollup merge of #71063 - LeSeulArtichaut:document-unsafe, r=Mark-SimulacrumDylan DPC-7/+28
Document unsafety in core::{option, hash} Helps with #66219. I think that the part that will need reviewing the most is the `hash/sip.rs` file. r? @LukasKalbertodt (or someone else from the libs team)
2020-04-24Document unsafety in `core::{panicking, alloc::layout, hint, ↵LeSeulArtichaut-16/+28
iter::adapters::zip}`
2020-04-23Add a note about fat pointersLeSeulArtichaut-0/+6
Co-Authored-By: Mark-Simulacrum <mark.simulacrum@gmail.com>
2020-04-23doc-example: Refactor pointer name to avoid confusioncohenarthur-4/+2
Changed raw pointer name from ptr to raw_pointer to avoid confusion with the `use std::ptr` statement a few lines above. This way the crate name and pointer name are well differenciated.
2020-04-23Rollup merge of #71470 - TyPR124:fix-doc-links, r=jonas-schievinkDylan DPC-1/+1
Fix doc links This fixes a few doc links which were causing `cargo doc` to fail when using `--document-private-items --document-hidden-items` on libstd. Most of the fixes are just escaping '[' and ']' characters in doc comments, and one change actually fixes a doc link.
2020-04-23Rollup merge of #71446 - Amanieu:transmute_copy, r=sfacklerDylan DPC-1/+6
Only use read_unaligned in transmute_copy if necessary I've noticed that this causes LLVM to generate poor code on targets that don't support unaligned memory accesses.
2020-04-23Rollup merge of #71442 - TimDiekmann:allocref-mut-ref, r=AmanieuDylan DPC-0/+47
Add a "by reference" adaptor for `AllocRef` Fixes rust-lang/wg-allocators#53 r? @Amanieu
2020-04-23Rollup merge of #71404 - cuviper:chain-unfused, r=scottmcmDylan DPC-35/+62
Don't fuse Chain in its second iterator Only the "first" iterator is actually set `None` when exhausted, depending on whether you iterate forward or backward. This restores behavior similar to the former `ChainState`, where it would transition from `Both` to `Front`/`Back` and only continue from that side. However, if you mix directions, then this may still set both sides to `None`, totally fusing the iterator. Fixes #71375 r? @scottmcm
2020-04-23libcore: more compact way to adjust test sizes for MiriRalf Jung-30/+16
2020-04-23Add note about paddingLeSeulArtichaut-2/+3
Co-authored-by: Mark-Simulacrum <mark.simulacrum@gmail.com>
2020-04-23Make VaList::arg link actually workTyler Ruckinger-1/+1
2020-04-23Merge branch 'master' into fix-doc-linksTyler Ruckinger-1/+3