about summary refs log tree commit diff
path: root/library/core/src
AgeCommit message (Collapse)AuthorLines
2024-06-16Remove reliance on const_trait in sort implementationsLukas Bergdoll-64/+66
const_trait in conjunction with specialization was deemed not ready for usage in this scenario. So instead a two-stage trait specialization approach is used. This approach is likely worse for compile-times. Future work that enables const_trait can revert back to the previous version as outlined in the comment marked FIXME(effects).
2024-06-16Apply review commentsLukas Bergdoll-90/+98
2024-06-15Redo SliceIndex implementationsScott McMurray-32/+86
2024-06-16update commentSlanterns-1/+1
2024-06-14div_euclid, rem_euclid: clarify/extend documentationRalf Jung-4/+6
2024-06-13Rollup merge of #126402 - firefighterduck:fix-unsafe-precon-copy, r=NilstriebMatthias Krüger-2/+1
Fix wrong `assert_unsafe_precondition` message for `core::ptr::copy` A small fix in the `assert_unsafe_precondition` message for `core::ptr::copy` as described by https://github.com/rust-lang/rust/issues/126400 . fixes #126400
2024-06-13Rollup merge of #126390 - Kriskras99:master, r=NilstriebMatthias Krüger-3/+3
Fix wording in {checked_}next_power_of_two Small documentation update
2024-06-13Rollup merge of #126360 - compiler-errors:uplift-structural-traits, r=lcnrMatthias Krüger-0/+2
Uplift `structural_traits.rs` into the new trait solver Self-explanatory. I will leave some comments inline regarding design decisions.
2024-06-13LangItem-ify Coroutine trait in solversMichael Goulet-0/+2
2024-06-13fix wrong assert_unsafe_precondition message for core::ptr::copyFlorian Sextl-2/+1
2024-06-13Rollup merge of #126384 - RalfJung:is_none_or, r=workingjubileeLeón Orell Valerian Liehr-1/+1
add tracking issue for is_none_or This was forgotten in https://github.com/rust-lang/rust/pull/126328. Cc https://github.com/rust-lang/rust/issues/126383
2024-06-13Rollup merge of #126347 - slanterns:try_simplify, r=scottmcmLeón Orell Valerian Liehr-10/+11
Simplify `try_*`'s signature on `Iterator` Inspired by https://github.com/rust-lang/rust/pull/126249#issuecomment-2161859295. r? `@scottmcm` (Seems there's no need to explicitly use `<Self as Iterator>::Item`? I only find this occurrence across the whole file.)
2024-06-13Fix wording in {checked_}next_power_of_twoChristiaan Biesterbosch-3/+3
2024-06-13add tracking issue for is_none_orRalf Jung-1/+1
2024-06-12Rollup merge of #126328 - RalfJung:is_none_or, r=workingjubileeJubilee-0/+26
Add Option::is_none_or ACP: https://github.com/rust-lang/libs-team/issues/212
2024-06-13Simplify `try_*` on `Iterator`Slanterns-10/+11
2024-06-12Auto merge of #126273 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrumbors-140/+94
Bump stage0 to 1.80.0 r? `@Mark-Simulacrum`
2024-06-12add is_none_orRalf Jung-0/+26
2024-06-12Rollup merge of #126322 - m-ou-se:panicinfo-and-panicinfo-2, r=RalfJungGuillaume Gomez-5/+4
Follow up to splitting core's PanicInfo and std's PanicInfo
2024-06-12Rollup merge of #126242 - yaahc:simplify-provider, r=jhprattGuillaume Gomez-26/+23
Simplify provider api to improve llvm ir This PR seeks to resolve the last concern in https://github.com/rust-lang/rust/issues/99301#issuecomment-1699427740 We resolve the issue by moving the type_id to be stored in the `Request` itself rather than being accessed through the `Erased` trait, letting the compiler infer that the value of the type id will not change between lookups. ### LLVM Codegen **Before** ``` ; <provider_test::MyError as core::error::Error>::provide ; Function Attrs: nonlazybind uwtable define void `@"_ZN61_$LT$provider_test..MyError$u20$as$u20$core..error..Error$GT$7provide17hd9c9de412063aa73E"(ptr` noalias nocapture noundef nonnull readonly align 1 %self, ptr noundef nonnull align 1 %request.0, ptr noalias nocapture noundef readonly align 8 dereferenceable(32) %request.1) unnamed_addr #0 personality ptr `@rust_eh_personality` { start: %0 = getelementptr inbounds i8, ptr %request.1, i64 24 %self.1.val.i = load ptr, ptr %0, align 8 %1 = tail call { i64, i64 } %self.1.val.i(ptr noundef nonnull align 1 %request.0), !noalias !15 %2 = extractvalue { i64, i64 } %1, 0 %3 = extractvalue { i64, i64 } %1, 1 %_18.i.i = icmp ne i64 %2, 1101338453689927725 %_2.i.i = icmp ne i64 %3, 472224167662714873 %or.cond.i.not.i = select i1 %_18.i.i, i1 true, i1 %_2.i.i br i1 %or.cond.i.not.i, label %_ZN4core5error7Request7provide17h8f8125d2543333e0E.exit, label %bb2.i ``` **After** ``` ; <provider_test::MyError as provider_test::Error>::provide ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable define void `@"_ZN63_$LT$provider_test..MyError$u20$as$u20$provider_test..Error$GT$7provide17h5bbf091795a6d359E"(ptr` noalias nocapture noundef nonnull readonly align 1 %self, ptr nocapture noundef nonnull align 8 %request.0, ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %request.1) unnamed_addr #2 personality ptr `@rust_eh_personality` { start: %_19.i = load i64, ptr %request.0, align 8, !noalias !3, !noundef !3 switch i64 %_19.i, label %_ZN13provider_test7Request7provide17heb3ee140962e3b2fE.exit [ i64 7665305208997882008, label %bb12.i i64 7050211241160863540, label %bb12.i3 i64 9112786072622981063, label %bb12.i11 ] ```
2024-06-12Fix deprecated version.Mara Bos-1/+1
2024-06-12Update doc comment on PanicInfo::message().Mara Bos-3/+2
2024-06-12Fix deprecation version.Mara Bos-1/+1
2024-06-12Clarify doc comment.Mara Bos-1/+1
2024-06-12Auto merge of #126319 - workingjubilee:rollup-lendnud, r=workingjubileebors-21/+60
Rollup of 16 pull requests Successful merges: - #123374 (DOC: Add FFI example for slice::from_raw_parts()) - #124514 (Recommend to never display zero disambiguators when demangling v0 symbols) - #125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking) - #125980 (Nvptx remove direct passmode) - #126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.) - #126210 (docs(core): make more const_ptr doctests assert instead of printing) - #126249 (Simplify `[T; N]::try_map` signature) - #126256 (Add {{target}} substitution to compiletest) - #126263 (Make issue-122805.rs big endian compatible) - #126281 (set_env: State the conclusion upfront) - #126286 (Make `storage-live.rs` robust against rustc internal changes.) - #126287 (Update a cranelift patch file for formatting changes.) - #126301 (Use `tidy` to sort crate attributes for all compiler crates.) - #126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`) - #126310 (Migrate run make prefer rlib) - #126314 (fix RELEASES: we do not support upcasting to auto traits) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-12Rollup merge of #126249 - workingjubilee:simplify-try-map-signature, r=scottmcmJubilee-5/+5
Simplify `[T; N]::try_map` signature People keep making fun of this signature for being so gnarly. Associated type bounds admit a much simpler scribbling. r? ````@scottmcm````
2024-06-12Rollup merge of #126210 - lolbinarycat:ptr_doctest_assert, r=workingjubileeJubilee-16/+22
docs(core): make more const_ptr doctests assert instead of printing improves on #124669
2024-06-12Rollup merge of #123374 - mgeier:doc-slice-from-raw-parts, r=scottmcmJubilee-0/+33
DOC: Add FFI example for slice::from_raw_parts() For some discussion, see https://users.rust-lang.org/t/missing-guidance-on-converting-ffi-ptr-length-to-slice/106048 See also #120608.
2024-06-12Revert "Rollup merge of #125362 - joboet:tait_hack, r=Nilstrieb"Oli Scherer-44/+117
This reverts commit 1e4bde1cb9736ad4b8d3b95fbfe1533015c1d165, reversing changes made to 4ee97fc3dbcddc9d69701e346a1be9e0b66855a7.
2024-06-11remove cfg(bootstrap)Pietro Albini-65/+19
2024-06-11replace version placeholderPietro Albini-75/+75
2024-06-11Fix display of panic message in recursive panic.Mara Bos-0/+5
2024-06-11Mention core's PanicInfo in error.md.Mara Bos-2/+3
2024-06-11Fix deprecation version.Mara Bos-1/+1
2024-06-11Rename std::panic::PanicInfo to PanicHookInfo.Mara Bos-20/+16
2024-06-11Formatting.Mara Bos-2/+6
2024-06-11Fix invalid markdown/html.Mara Bos-1/+1
2024-06-11Impl Display for PanicPayload to simplify things.Mara Bos-1/+1
2024-06-11Remove core::panic::PanicInfo::internal_constructor.Mara Bos-14/+4
It no longer needs to be public.
2024-06-11Update doc comment about core::panicking.Mara Bos-7/+9
2024-06-11Add core::panic::PanicInfo::payload() for compatibility.Mara Bos-0/+18
2024-06-11Document difference between core and std's PanicInfo.Mara Bos-0/+9
2024-06-11Split core's PanicInfo and std's PanicInfo.Mara Bos-75/+9
2024-06-11Skip fast path for dec2flt when optimize_for_sizeDion Dokter-2/+4
2024-06-11Simplify `[T; N]::try_map` signatureJubilee Young-5/+5
People keep making fun of this signature for being so gnarly. Associated type bounds lend it a much simpler scribbling. ChangeOutputType can also come along for the ride.
2024-06-10Simplify provider api to improve llvm irJane Losare-Lusby-26/+23
2024-06-10Rollup merge of #126191 - ivan-shrimp:nonzero_doc, r=scottmcmMatthias Krüger-10/+32
Fix `NonZero` doctest inconsistencies <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> --> `NonZero`'s doctests contain both `?` and `.unwrap()` with no obvious reason for the difference, so this changes all of them to `?`. Also removes an explicit `std::num::NonZero`.
2024-06-09Update docs for AtomicU8/I8.Zachary S-15/+31
Clarify that they always have the same alignment as u8/i8, (unlike other atomic types). Clarify in from_ptr that alignment is never an issue because of this.
2024-06-09Update safety docs for AtomicBool::from_ptr.Zachary S-2/+2
Clarify that alignment is never an issue, since `align_of::<AtomicBool>() == 1`.
2024-06-09docs(core): make more const_ptr doctests assert instead of printingbinarycat-16/+22
fixes #124669