Skip to content

Conversation

fmease
Copy link
Member

@fmease fmease commented May 18, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

mejrs and others added 18 commits May 9, 2025 23:16
Co-authored-by: Ookiineko <chiisaineko@protonmail.com>
…tation

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Use the existing Lemire (decimal -> float) and Dragon / Grisu algorithms
(float -> decimal) to add support for `f16`. This allows updating the
implementation for `Display` to the expected behavior for `Display`
(currently it prints the a hex bitwise representation), matching other
floats, and adds a `FromStr` implementation.

In order to avoid crashes when compiling with Cranelift or on targets
where f16 is not well supported, a fallback is used if
`cfg(target_has_reliable_f16)` is not true.
Extend the existing tests for `f32` and `f64` with versions that include
`f16`'s new printing and parsing implementations.

Co-authored-by: Speedy_Lex <alex.ciocildau@gmail.com>
This requires a fix to the subnormal test to cap the maximum allowed
value within the maximum mantissa.
…Simulacrum

Add `f16` formatting and parsing

Use the same algorithms as for `f32` and `f64` to implement `f16` parsing and printing.

try-job: x86_64-gnu-aux
Safer implementation of RepeatN

I've seen the "Use MaybeUninit for RepeatN" commit while reading This Week In Rust and immediately thought about something I've written some time ago - https://github.com/Soveu/repeat_finite/blob/master/src/lib.rs.

Using the fact, that `Option` will find niche in `(T, NonZeroUsize)`, we can construct something that has the same size as `(T, usize)` while completely getting rid of `MaybeUninit`.
This leaves only `unsafe` on `TrustedLen`, which is pretty neat.
Cygwin support in rustc

This PR builds host rustc targeting cygwin.

- [x] rust-lang/stacker#122
- [x] nagisa/rust_libloading#173
- [x] Detegr/rust-ctrlc#131
- [x] rust-random/getrandom#654
- [x] msys2/MSYS2-packages#5350
- [x] rust-lang#140886
- [x] rust-lang#140921
- [x] rust-lang#140973

Currently supported:
* rustc
* rustdoc
* rustfmt
* clippy

Blocking:
* cargo: blocked by rust-lang/socket2#568
* rust-analyzer: needs `cargo update`, fixed upstream

```
$ rustc --version --verbose
rustc 1.88.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-cygwin
release: 1.88.0-dev
LLVM version: 20.1.4
```
make `rustc_attr_parsing` less dominant in the rustc crate graph

It has/had a glob re-export of `rustc_attr_data_structures`, which is a crate much lower in the graph, and a lot of crates were using it *just* (or *mostly*) for that re-export, while they can rely on `rustc_attr_data_structures` directly.

Previous graph:
![graph_1](https://github.com/user-attachments/assets/f4a5f13c-4222-4903-b56d-28c83511fcbd)

Graph with this PR:
![graph_2](https://github.com/user-attachments/assets/1e053d9c-75cc-402b-84df-86229c98277a)

The first commit keeps the re-export, and just changes the dependency if possible. The second commit is the "breaking change" which removes the re-export, and "explicitly" adds the `rustc_attr_data_structures` dependency where needed. It also switches over some src/tools/*.

The second commit is actually a lot more involved than I expected. Please let me know if it's a better idea to back it out and just keep the first commit.
…bilee

[std] fix the presentation of `split_off_mut` and `split_off` documentation

Fixes rust-lang#141107

r? libs
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels May 18, 2025
@fmease
Copy link
Member Author

fmease commented May 18, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented May 18, 2025

📌 Commit 3ea368a has been approved by fmease

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#127013 (Add `f16` formatting and parsing)
 - rust-lang#130887 (Safer implementation of RepeatN)
 - rust-lang#140154 (Cygwin support in rustc)
 - rust-lang#140874 (make `rustc_attr_parsing` less dominant in the rustc crate graph)
 - rust-lang#141094 (add regression test for rust-lang#101650)
 - rust-lang#141110 ([std] fix the presentation of `split_off_mut` and `split_off` documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented May 18, 2025

⌛ Testing commit 3ea368a with merge 2d951c1...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-distcheck failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [codegen] tests/codegen/iter-repeat-n-trivial-drop.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--input-file" "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/iter-repeat-n-trivial-drop/iter-repeat-n-trivial-drop.ll" "/checkout/tests/codegen/iter-repeat-n-trivial-drop.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen/iter-repeat-n-trivial-drop.rs:29:17: error: CHECK-NEXT: is not on the line after the previous match
 // CHECK-NEXT: %[[DEC:.+]] = add i64 %[[COUNT]], -1
                ^
/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/iter-repeat-n-trivial-drop/iter-repeat-n-trivial-drop.ll:19:2: note: 'next' match was here
 %2 = add i64 %0, -1
 ^
/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/iter-repeat-n-trivial-drop/iter-repeat-n-trivial-drop.ll:17:7: note: previous match ended here
bb8.i: ; preds = %start
      ^
/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/iter-repeat-n-trivial-drop/iter-repeat-n-trivial-drop.ll:18:1: note: non-matching line after previous match is here
 %1 = getelementptr inbounds nuw i8, ptr %it, i64 8
^

Input file: /checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/iter-repeat-n-trivial-drop/iter-repeat-n-trivial-drop.ll
Check file: /checkout/tests/codegen/iter-repeat-n-trivial-drop.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
         1: ; ModuleID = 'iter_repeat_n_trivial_drop.80fa96dad9145ebd-cgu.0' 
         2: source_filename = "iter_repeat_n_trivial_drop.80fa96dad9145ebd-cgu.0" 
         3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" 
         4: target triple = "x86_64-unknown-linux-gnu" 
         5:  
         6: @__rust_no_alloc_shim_is_unstable = external global i8 
         7: @alloc_3e3222eab6a509f29fa54d8acd188f56 = private unnamed_addr constant [53 x i8] c"/checkout/tests/codegen/iter-repeat-n-trivial-drop.rs", align 1 
         8: @alloc_8e75433513d2c9e77591417f09572823 = private unnamed_addr constant <{ ptr, [16 x i8] }> <{ ptr @alloc_3e3222eab6a509f29fa54d8acd188f56, [16 x i8] c"5\00\00\00\00\00\00\007\00\00\00\11\00\00\00" }>, align 8 
         9:  
        10: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable 
        11: define { i16, i16 } @iter_repeat_n_next(ptr noalias nocapture noundef align 8 dereferenceable(16) %it) unnamed_addr #0 { 
        12: start: 
        13:  %0 = load i64, ptr %it, align 8, !alias.scope !3, !noundef !6 
        14:  %.not.i = icmp eq i64 %0, 0 
        15:  br i1 %.not.i, label %"_ZN106_$LT$core..iter..sources..repeat_n..RepeatN$LT$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h64fd80f3d6723578E.exit", label %bb8.i 
        16:  
        17: bb8.i: ; preds = %start 
        18:  %1 = getelementptr inbounds nuw i8, ptr %it, i64 8 
        19:  %2 = add i64 %0, -1 
next:29      !~~~~~~~~~~~~~~~~~~  error: match on wrong line
        20:  %3 = load i16, ptr %1, align 8, !alias.scope !3 
        21:  store i64 %2, ptr %it, align 8, !alias.scope !3 
        22:  br label %"_ZN106_$LT$core..iter..sources..repeat_n..RepeatN$LT$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h64fd80f3d6723578E.exit" 
        23:  
        24: "_ZN106_$LT$core..iter..sources..repeat_n..RepeatN$LT$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h64fd80f3d6723578E.exit": ; preds = %start, %bb8.i 
        25:  %_0.sroa.5.0.i = phi i16 [ undef, %start ], [ %3, %bb8.i ] 
        26:  %_0.sroa.0.0.i = phi i16 [ 0, %start ], [ 1, %bb8.i ] 
        27:  %4 = insertvalue { i16, i16 } poison, i16 %_0.sroa.0.0.i, 0 
        28:  %5 = insertvalue { i16, i16 } %4, i16 %_0.sroa.5.0.i, 1 
        29:  ret { i16, i16 } %5 
        30: } 
        31:  
        32: ; Function Attrs: nonlazybind uwtable 
        33: define void @vec_extend_via_iter_repeat_n(ptr dead_on_unwind noalias nocapture noundef writable writeonly sret([24 x i8]) align 8 dereferenceable(24) %_0) unnamed_addr #1 personality ptr @rust_eh_personality { 
        34: start: 
        35:  %0 = load volatile i8, ptr @__rust_no_alloc_shim_is_unstable, align 1, !noalias !7 
        36: ; call __rustc::__rust_alloc 
        37:  %_0.i.i.i.i.i = tail call noalias noundef dereferenceable_or_null(1234) ptr @_RNvCsgQOAYXgFqHH_7___rustc12___rust_alloc(i64 noundef range(i64 1, 0) 1234, i64 noundef range(i64 1, -9223372036854775807) 1) #7, !noalias !7 
        38:  %1 = icmp eq ptr %_0.i.i.i.i.i, null 
        39:  br i1 %1, label %bb3.i, label %"_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$16with_capacity_in17had48957ce17b0732E.exit", !prof !10 
        40:  
        41: bb3.i: ; preds = %start 
        42: ; call alloc::raw_vec::handle_error 
        43:  tail call void @_ZN5alloc7raw_vec12handle_error17headb606707de42d0E(i64 noundef 1, i64 1234, ptr noalias noundef nonnull readonly align 8 dereferenceable(24) @alloc_8e75433513d2c9e77591417f09572823) #8 
        44:  unreachable 
        45:  
        46: "_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$16with_capacity_in17had48957ce17b0732E.exit": ; preds = %start 
        47:  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1234) %_0.i.i.i.i.i, i8 42, i64 1234, i1 false), !noalias !11 
        48:  store i64 1234, ptr %_0, align 8 
        49:  %v.sroa.4.0._0.sroa_idx = getelementptr inbounds nuw i8, ptr %_0, i64 8 
        50:  store ptr %_0.i.i.i.i.i, ptr %v.sroa.4.0._0.sroa_idx, align 8 
        51:  %v.sroa.5.0._0.sroa_idx = getelementptr inbounds nuw i8, ptr %_0, i64 16 
        52:  store i64 1234, ptr %v.sroa.5.0._0.sroa_idx, align 8 
        53:  ret void 
        54: } 
        55:  
        56: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: write) uwtable 
        57: define void @array_repeat_not_copy(ptr dead_on_unwind noalias nocapture noundef writable writeonly sret([16 x i8]) align 2 dereferenceable(16) initializes((0, 16)) %_0, i16 noundef %item) unnamed_addr #2 personality ptr @rust_eh_personality { 
        58: start: 
        59:  %0 = insertelement <8 x i16> poison, i16 %item, i64 0 
        60:  %1 = shufflevector <8 x i16> %0, <8 x i16> poison, <8 x i32> zeroinitializer 
        61:  store <8 x i16> %1, ptr %_0, align 2, !alias.scope !22 
        62:  ret void 
        63: } 
        64:  
        65: ; Function Attrs: nounwind nonlazybind uwtable 
        66: declare noundef range(i32 0, 10) i32 @rust_eh_personality(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #3 
        67:  
        68: ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) 
        69: declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 
        70:  
        71: ; __rustc::__rust_alloc 
        72: ; Function Attrs: nounwind nonlazybind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable 
        73: declare noalias noundef ptr @_RNvCsgQOAYXgFqHH_7___rustc12___rust_alloc(i64 noundef, i64 allocalign noundef) unnamed_addr #5 
        74:  
        75: ; alloc::raw_vec::handle_error 
        76: ; Function Attrs: cold minsize noreturn nonlazybind optsize uwtable 
        77: declare void @_ZN5alloc7raw_vec12handle_error17headb606707de42d0E(i64 noundef range(i64 0, -9223372036854775807), i64, ptr noalias noundef readonly align 8 dereferenceable(24)) unnamed_addr #6 
        78:  
        79: attributes #0 = { mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } 
        80: attributes #1 = { nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } 
        81: attributes #2 = { mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: write) uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } 
        82: attributes #3 = { nounwind nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } 
        83: attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 
        84: attributes #5 = { nounwind nonlazybind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable "alloc-family"="__rust_alloc" "probe-stack"="inline-asm" "target-cpu"="x86-64" } 
        85: attributes #6 = { cold minsize noreturn nonlazybind optsize uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } 
        86: attributes #7 = { nounwind } 
        87: attributes #8 = { noreturn } 
        88:  
        89: !llvm.module.flags = !{!0, !1} 
        90: !llvm.ident = !{!2} 
        91:  
        92: !0 = !{i32 8, !"PIC Level", i32 2} 
        93: !1 = !{i32 2, !"RtLibUseGOT", i32 1} 
        94: !2 = !{!"rustc version 1.89.0-nightly (2d951c1c1 2025-05-18)"} 
        95: !3 = !{!4} 
        96: !4 = distinct !{!4, !5, !"_ZN106_$LT$core..iter..sources..repeat_n..RepeatN$LT$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h64fd80f3d6723578E: %self"} 
        97: !5 = distinct !{!5, !"_ZN106_$LT$core..iter..sources..repeat_n..RepeatN$LT$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h64fd80f3d6723578E"} 
        98: !6 = !{} 
        99: !7 = !{!8} 
       100: !8 = distinct !{!8, !9, !"_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$15try_allocate_in17h73869756fa64b1eeE: %_0"} 
       101: !9 = distinct !{!9, !"_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$15try_allocate_in17h73869756fa64b1eeE"} 
       102: !10 = !{!"branch_weights", !"expected", i32 1, i32 2000} 
       103: !11 = !{!12, !14, !16, !18, !20} 
       104: !12 = distinct !{!12, !13, !"_ZN5alloc3vec16Vec$LT$T$C$A$GT$14extend_trusted28_$u7b$$u7b$closure$u7d$$u7d$17h2d920174559c31fcE: %_1"} 
       105: !13 = distinct !{!13, !"_ZN5alloc3vec16Vec$LT$T$C$A$GT$14extend_trusted28_$u7b$$u7b$closure$u7d$$u7d$17h2d920174559c31fcE"} 
       106: !14 = distinct !{!14, !15, !"_ZN4core4iter6traits8iterator8Iterator8for_each4call28_$u7b$$u7b$closure$u7d$$u7d$17h8175a6ce96ea74bcE: %_1"} 
       107: !15 = distinct !{!15, !"_ZN4core4iter6traits8iterator8Iterator8for_each4call28_$u7b$$u7b$closure$u7d$$u7d$17h8175a6ce96ea74bcE"} 
       108: !16 = distinct !{!16, !17, !"_ZN4core4iter6traits8iterator8Iterator4fold17hb0446c9c00dbdb60E: %f"} 
       109: !17 = distinct !{!17, !"_ZN4core4iter6traits8iterator8Iterator4fold17hb0446c9c00dbdb60E"} 
       110: !18 = distinct !{!18, !19, !"_ZN4core4iter6traits8iterator8Iterator8for_each17h4345137ce1f93608E: %f"} 
       111: !19 = distinct !{!19, !"_ZN4core4iter6traits8iterator8Iterator8for_each17h4345137ce1f93608E"} 
       112: !20 = distinct !{!20, !21, !"_ZN5alloc3vec16Vec$LT$T$C$A$GT$14extend_trusted17h9f4abebbd75968a4E: %self"} 
       113: !21 = distinct !{!21, !"_ZN5alloc3vec16Vec$LT$T$C$A$GT$14extend_trusted17h9f4abebbd75968a4E"} 
       114: !22 = !{!23} 
       115: !23 = distinct !{!23, !24, !"_ZN4core5array6repeat17h35c3a230c2f2d7efE: %_0"} 
       116: !24 = distinct !{!24, !"_ZN4core5array6repeat17h35c3a230c2f2d7efE"} 
>>>>>>
------------------------------------------



failures:
    [codegen] tests/codegen/iter-repeat-n-trivial-drop.rs

test result: FAILED. 764 passed; 1 failed; 85 ignored; 0 measured; 0 filtered out; finished in 9.49s

Some tests failed in compiletest suite=codegen mode=codegen host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 0:38:18
make: *** [Makefile:49: check] Error 1
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:44:10
  local time: Sun May 18 20:36:06 UTC 2025
  network time: Sun, 18 May 2025 20:36:06 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Collaborator

bors commented May 18, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 18, 2025
@fmease fmease closed this May 18, 2025
@fmease fmease deleted the rollup-zeeorxb branch May 18, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants