许杰友 Jieyou Xu (Joe)
a8ccf97445
Rollup merge of #126288 - x4exr:patch-1, r=dtolnay
...
doc: Added commas where needed
<!--
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>
-->
2024-06-17 04:53:55 +01:00
bors
e794b0f855
Auto merge of #125720 - folkertdev:optimize_for_size-ptr-rotate, r=Amanieu
...
make `ptr::rotate` smaller when using `optimize_for_size`
code to reproduce https://github.com/folkertdev/optimize_for_size-slice-rotate
In the example the size of `.text` goes down from 1624 to 276 bytes.
```
> cargo size --release --features "left-std" -- -A
slice-rotate :
section size addr
.vector_table 1024 0x0
.text 1624 0x400
.rodata 0 0xa58
.data 0 0x20000000
.gnu.sgstubs 0 0xa60
.bss 0 0x20000000
.uninit 0 0x20000000
.debug_loc 591 0x0
.debug_abbrev 1452 0x0
.debug_info 10634 0x0
.debug_aranges 480 0x0
.debug_ranges 1504 0x0
.debug_str 11716 0x0
.comment 72 0x0
.ARM.attributes 56 0x0
.debug_frame 1036 0x0
.debug_line 5837 0x0
Total 36026
> cargo size --release --features "left-size" -- -A
slice-rotate :
section size addr
.vector_table 1024 0x0
.text 276 0x400
.rodata 0 0x514
.data 0 0x20000000
.gnu.sgstubs 0 0x520
.bss 0 0x20000000
.uninit 0 0x20000000
.debug_loc 347 0x0
.debug_abbrev 965 0x0
.debug_info 4216 0x0
.debug_aranges 168 0x0
.debug_ranges 216 0x0
.debug_str 3615 0x0
.comment 72 0x0
.ARM.attributes 56 0x0
.debug_frame 232 0x0
.debug_line 723 0x0
Total 11910
```
tracking issue: https://github.com/rust-lang/rust/issues/125612
2024-06-17 01:45:22 +00:00
Rayyan Khan
fe9154c64e
doc: Added commas where needed
2024-06-16 15:58:44 -07:00
Lukas Bergdoll
24697ac66b
Fix doc-link issue
2024-06-16 20:26:33 +02:00
Lukas Bergdoll
9889ab1f60
Remove reliance on const_trait in sort implementations
...
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-16 17:17:36 +02:00
Lukas Bergdoll
f7496f5f85
Apply review comments
2024-06-16 08:27:49 +02:00
Scott McMurray
33c4817d98
Redo SliceIndex implementations
2024-06-15 17:39:25 -07:00
Slanterns
6cce48838b
update comment
2024-06-16 06:31:37 +08:00
Ralf Jung
9e851041d7
div_euclid, rem_euclid: clarify/extend documentation
2024-06-14 11:18:59 +02:00
Matthias Krüger
3494ea1818
Rollup merge of #126402 - firefighterduck:fix-unsafe-precon-copy, r=Nilstrieb
...
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-13 22:55:49 +02:00
Matthias Krüger
5de59519fb
Rollup merge of #126390 - Kriskras99:master, r=Nilstrieb
...
Fix wording in {checked_}next_power_of_two
Small documentation update
2024-06-13 22:55:48 +02:00
Matthias Krüger
4dd8813afd
Rollup merge of #126360 - compiler-errors:uplift-structural-traits, r=lcnr
...
Uplift `structural_traits.rs` into the new trait solver
Self-explanatory. I will leave some comments inline regarding design decisions.
2024-06-13 22:55:46 +02:00
Michael Goulet
d3812ac95f
LangItem-ify Coroutine trait in solvers
2024-06-13 09:34:28 -04:00
Florian Sextl
0cc099b8a2
fix wrong assert_unsafe_precondition message for core::ptr::copy
2024-06-13 14:45:45 +02:00
León Orell Valerian Liehr
f1a4f30940
Rollup merge of #126384 - RalfJung:is_none_or, r=workingjubilee
...
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-13 13:05:27 +02:00
León Orell Valerian Liehr
1fc56c94f1
Rollup merge of #126347 - slanterns:try_simplify, r=scottmcm
...
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-13 13:05:24 +02:00
Christiaan Biesterbosch
523408e661
Fix wording in {checked_}next_power_of_two
2024-06-13 11:46:42 +02:00
Ralf Jung
898b541cb6
add tracking issue for is_none_or
2024-06-13 10:09:59 +02:00
Jubilee
f5af7eea1a
Rollup merge of #126328 - RalfJung:is_none_or, r=workingjubilee
...
Add Option::is_none_or
ACP: https://github.com/rust-lang/libs-team/issues/212
2024-06-12 20:03:20 -07:00
Slanterns
fac1733925
Simplify try_* on Iterator
2024-06-13 02:57:36 +08:00
bors
c25ac9d6cc
Auto merge of #126273 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrum
...
Bump stage0 to 1.80.0
r? `@Mark-Simulacrum`
2024-06-12 18:15:32 +00:00
Ralf Jung
63bdcaa2d9
add is_none_or
2024-06-12 16:12:29 +02:00
Guillaume Gomez
5d22e7a881
Rollup merge of #126322 - m-ou-se:panicinfo-and-panicinfo-2, r=RalfJung
...
Follow up to splitting core's PanicInfo and std's PanicInfo
2024-06-12 15:45:03 +02:00
Guillaume Gomez
d1414c5e0d
Rollup merge of #126242 - yaahc:simplify-provider, r=jhpratt
...
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-12 15:45:00 +02:00
Mara Bos
749a685626
Fix deprecated version.
2024-06-12 13:23:21 +02:00
Mara Bos
9afc91349e
Update doc comment on PanicInfo::message().
2024-06-12 13:17:42 +02:00
Mara Bos
1dc7952303
Fix deprecation version.
2024-06-12 13:15:17 +02:00
Mara Bos
cae18fa7b0
Clarify doc comment.
2024-06-12 13:15:10 +02:00
bors
bbe9a9c20b
Auto merge of #126319 - workingjubilee:rollup-lendnud, r=workingjubilee
...
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-12 11:10:50 +00:00
Jubilee
4de77b6d8a
Rollup merge of #126249 - workingjubilee:simplify-try-map-signature, r=scottmcm
...
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-12 03:57:21 -07:00
Jubilee
3a37293e92
Rollup merge of #126210 - lolbinarycat:ptr_doctest_assert, r=workingjubilee
...
docs(core): make more const_ptr doctests assert instead of printing
improves on #124669
2024-06-12 03:57:21 -07:00
Jubilee
8d3b9a19cf
Rollup merge of #123374 - mgeier:doc-slice-from-raw-parts, r=scottmcm
...
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-12 03:57:18 -07:00
Oli Scherer
39e7bf6826
Revert "Rollup merge of #125362 - joboet:tait_hack, r=Nilstrieb"
...
This reverts commit 1e4bde1cb9 , reversing
changes made to 4ee97fc3db .
2024-06-12 08:47:49 +00:00
Pietro Albini
cd2ed56502
remove cfg(bootstrap)
2024-06-11 16:52:04 +02:00
Pietro Albini
be9e27e490
replace version placeholder
2024-06-11 16:52:02 +02:00
Mara Bos
fb0990d1e1
Fix display of panic message in recursive panic.
2024-06-11 15:47:00 +02:00
Mara Bos
877a26f6c9
Mention core's PanicInfo in error.md.
2024-06-11 15:47:00 +02:00
Mara Bos
3854357ad2
Fix deprecation version.
2024-06-11 15:47:00 +02:00
Mara Bos
64e56db72a
Rename std::panic::PanicInfo to PanicHookInfo.
2024-06-11 15:47:00 +02:00
Mara Bos
b6180a9185
Formatting.
2024-06-11 15:47:00 +02:00
Mara Bos
6b2d7c4707
Fix invalid markdown/html.
2024-06-11 15:47:00 +02:00
Mara Bos
1642de33d3
Impl Display for PanicPayload to simplify things.
2024-06-11 15:46:59 +02:00
Mara Bos
0266bbf6e4
Remove core::panic::PanicInfo::internal_constructor.
...
It no longer needs to be public.
2024-06-11 15:46:59 +02:00
Mara Bos
83dd214f06
Update doc comment about core::panicking.
2024-06-11 15:46:59 +02:00
Mara Bos
16dfc6ddc1
Add core::panic::PanicInfo::payload() for compatibility.
2024-06-11 15:46:59 +02:00
Mara Bos
a519dc85f8
Document difference between core and std's PanicInfo.
2024-06-11 15:46:59 +02:00
Mara Bos
e3e815370e
Split core's PanicInfo and std's PanicInfo.
2024-06-11 15:46:59 +02:00
Dion Dokter
c4391b326e
Skip fast path for dec2flt when optimize_for_size
2024-06-11 13:24:35 +02:00
Jubilee Young
d6955445f5
Simplify [T; N]::try_map signature
...
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-11 01:50:43 -07:00
Jane Losare-Lusby
6e3134972e
Simplify provider api to improve llvm ir
2024-06-10 13:20:22 -07:00