Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #136850

Closed
wants to merge 21 commits into from
Closed

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Feb 11, 2025

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

yotamofek and others added 21 commits January 21, 2025 07:40
…e conversion functions

Having these implementation available crate-wide means that platforms not using sockets for their networking code have to stub out the libc definitions required to support them. This PR moves the conversions to private helper functions that are only available where actually needed.

I also fixed the signature of the function converting from a C socket address to a Rust one: taking a reference to a `sockaddr_storage` resulted in unsound usage inside  `LookupHost::next`, which could create a reference to a structure smaller than `sockaddr_storage`. Thus I've replaced the argument type with a pointer and made the function `unsafe`.
We choose to test for Linux and Windows instead of random other targets.
This should guarantee it tests what we want it to test and no more.
Co-authored-by: Ookiineko <[email protected]>
Co-authored-by: nora <[email protected]>
Co-authored-by: Jubilee <[email protected]>
We cannot produce anything useful if asked to compile unknown targets.
We should handle the error immediately at the point of discovery instead
of propagating it upward, and preferably in the simplest way: Die.

This allows cleaning up our "error-handling" spread across 5 crates.
…=chenyukang,workingjubilee

Add cygwin target.

This PR simply adds cygwin target together with msys2 target, based on `@ookiineko` 's (the account has been deleted) [work](https://github.com/ookiineko-cygport/rust) on cygwin target. My full work is here: rust-lang/rust@master...Berrysoft:rust:dev/cygwin

I have succeeded in building a new rustc for cygwin target, and eventually distributed a new version of [fish-shell](https://github.com/Berrysoft/fish-shell/releases) (rewritten by Rust) for MSYS2.

I will open a new PR to fix std if this PR is accepted.
…piler-errors

Small `rustc_resolve` cleanups

1. Don't open-code `Reverse`
2. Use slice patterns where possible
std: replace the `FromInner` implementation for addresses with private conversion functions

Having these implementation available crate-wide means that platforms not using sockets for their networking code have to stub out the libc definitions required to support them. This PR moves the conversions to private helper functions that are only available where actually needed.

I also fixed the signature of the function converting from a C socket address to a Rust one: taking a reference to a `sockaddr_storage` resulted in unsound usage inside  `LookupHost::next`, which could create a reference to a structure smaller than `sockaddr_storage`. Thus I've replaced the argument type with a pointer and made the function `unsafe`.
…or-tests, r=saethlin

tests: `-Copt-level=3` instead of `-O` in assembly tests

An effective blocker for redefining the meaning of `-O` is to stop reusing this somewhat ambiguous alias in our own assembly test suite. The choice between `-Copt-level=2` and `-Copt-level=3` is arbitrary for most of our tests. In most cases it makes no difference, so I set most of them to `-Copt-level=3`, as it will lead to slightly more "normalized" assembly.
…or-codegen-tests, r=saethlin

tests: `-Copt-level=3` instead of `-O` in codegen tests

An effective blocker for redefining the meaning of `-O` is to stop reusing this somewhat ambiguous alias in our own codegen test suite. The choice between `-Copt-level=2` and `-Copt-level=3` is arbitrary for most of our tests. In most cases it makes no difference, so I set most of them to `-Copt-level=3`, as it will lead to slightly more "normalized" codegen.
…be-impossible, r=compiler-errors

compiler: die immediately instead of handling unknown target codegen

We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die.

This allows cleaning up our "error-handling" spread across 5 crates.
@rustbot rustbot added O-solid Operating System: SOLID 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. rollup A PR which is a rollup labels Feb 11, 2025
@jhpratt
Copy link
Member Author

jhpratt commented Feb 11, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 11, 2025

📌 Commit f5ef201 has been approved by jhpratt

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 11, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 11, 2025
@bors
Copy link
Contributor

bors commented Feb 11, 2025

⌛ Testing commit f5ef201 with merge bd68693...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 11, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#134999 (Add cygwin target.)
 - rust-lang#135677 (Small `rustc_resolve` cleanups)
 - rust-lang#136699 (std: replace the `FromInner` implementation for addresses with private conversion functions)
 - rust-lang#136758 (tests: `-Copt-level=3` instead of `-O` in assembly tests)
 - rust-lang#136761 (tests: `-Copt-level=3` instead of `-O` in codegen tests)
 - rust-lang#136833 (compiler: die immediately instead of handling unknown target codegen)

Failed merges:

 - rust-lang#136808 (Try to recover from path sep error in type parsing)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [codegen] tests/codegen/zst-offset.rs ... ok

failures:

---- [codegen] tests/codegen/dont-shuffle-bswaps.rs#OPT3 stdout ----

error in revision `OPT3`: verification with 'FileCheck' failed
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/dont-shuffle-bswaps.OPT3/dont-shuffle-bswaps.ll" "/checkout/tests/codegen/dont-shuffle-bswaps.rs" "--check-prefix=CHECK" "--check-prefix" "OPT3" "--allow-unused-prefixes" "--dump-input-context" "100"
--- stderr -------------------------------
--- stderr -------------------------------
/checkout/tests/codegen/dont-shuffle-bswaps.rs:15:10: error: OPT3: expected string not found in input
// OPT3: load <8 x i16>
         ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/dont-shuffle-bswaps.OPT3/dont-shuffle-bswaps.ll:7:32: note: scanning from here
define dso_local void @convert(ptr dead_on_unwind noalias nocapture noundef writable writeonly sret([16 x i8]) align 1 dereferenceable(16) %_0, ptr noalias nocapture noundef readonly align 2 dereferenceable(16) %value) unnamed_addr #0 {
                               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/dont-shuffle-bswaps.OPT3/dont-shuffle-bswaps.ll:9:8: note: possible intended match here
 %_4 = load i16, ptr %value, align 2, !noundef !1


Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/dont-shuffle-bswaps.OPT3/dont-shuffle-bswaps.ll
Check file: /checkout/tests/codegen/dont-shuffle-bswaps.rs

-dump-input=help explains the following input dump.
Input was:
<<<<<<
<<<<<<
            1: ; ModuleID = 'dont_shuffle_bswaps.5c93dbc6d133cf57-cgu.0' 
            2: source_filename = "dont_shuffle_bswaps.5c93dbc6d133cf57-cgu.0" 
            3: target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" 
            5:  
            5:  
            6: ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 
            7: define dso_local void @convert(ptr dead_on_unwind noalias nocapture noundef writable writeonly sret([16 x i8]) align 1 dereferenceable(16) %_0, ptr noalias nocapture noundef readonly align 2 dereferenceable(16) %value) unnamed_addr #0 { 
check:15'0                                    X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:15'0     ~~~~~~~
check:15'0     ~~~~~~~
            9:  %_4 = load i16, ptr %value, align 2, !noundef !1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:15'1            ?                                           possible intended match
           10:  %0 = tail call i16 @llvm.bswap.i16(i16 %_4) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           11:  %1 = getelementptr inbounds i8, ptr %value, i32 2 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           12:  %_6 = load i16, ptr %1, align 2, !noundef !1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  %2 = tail call i16 @llvm.bswap.i16(i16 %_6) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           14:  %3 = getelementptr inbounds i8, ptr %value, i32 4 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           15:  %_8 = load i16, ptr %3, align 2, !noundef !1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           16:  %4 = tail call i16 @llvm.bswap.i16(i16 %_8) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           17:  %5 = getelementptr inbounds i8, ptr %value, i32 6 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  %_10 = load i16, ptr %5, align 2, !noundef !1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           19:  %6 = tail call i16 @llvm.bswap.i16(i16 %_10) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           20:  %7 = getelementptr inbounds i8, ptr %value, i32 8 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  %_12 = load i16, ptr %7, align 2, !noundef !1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           22:  %8 = tail call i16 @llvm.bswap.i16(i16 %_12) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           23:  %9 = getelementptr inbounds i8, ptr %value, i32 10 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           24:  %_14 = load i16, ptr %9, align 2, !noundef !1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           25:  %10 = tail call i16 @llvm.bswap.i16(i16 %_14) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  %11 = getelementptr inbounds i8, ptr %value, i32 12 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           27:  %_16 = load i16, ptr %11, align 2, !noundef !1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           28:  %12 = tail call i16 @llvm.bswap.i16(i16 %_16) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           29:  %13 = getelementptr inbounds i8, ptr %value, i32 14 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           30:  %_18 = load i16, ptr %13, align 2, !noundef !1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           31:  %14 = tail call i16 @llvm.bswap.i16(i16 %_18) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           32:  store i16 %0, ptr %_0, align 1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           33:  %addr16.sroa.2.0._0.sroa_idx = getelementptr inbounds i8, ptr %_0, i32 2 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           34:  store i16 %2, ptr %addr16.sroa.2.0._0.sroa_idx, align 1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           35:  %addr16.sroa.3.0._0.sroa_idx = getelementptr inbounds i8, ptr %_0, i32 4 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           36:  store i16 %4, ptr %addr16.sroa.3.0._0.sroa_idx, align 1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           37:  %addr16.sroa.4.0._0.sroa_idx = getelementptr inbounds i8, ptr %_0, i32 6 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           38:  store i16 %6, ptr %addr16.sroa.4.0._0.sroa_idx, align 1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           39:  %addr16.sroa.5.0._0.sroa_idx = getelementptr inbounds i8, ptr %_0, i32 8 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           40:  store i16 %8, ptr %addr16.sroa.5.0._0.sroa_idx, align 1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           41:  %addr16.sroa.6.0._0.sroa_idx = getelementptr inbounds i8, ptr %_0, i32 10 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           42:  store i16 %10, ptr %addr16.sroa.6.0._0.sroa_idx, align 1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           43:  %addr16.sroa.7.0._0.sroa_idx = getelementptr inbounds i8, ptr %_0, i32 12 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           44:  store i16 %12, ptr %addr16.sroa.7.0._0.sroa_idx, align 1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           45:  %addr16.sroa.8.0._0.sroa_idx = getelementptr inbounds i8, ptr %_0, i32 14 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           46:  store i16 %14, ptr %addr16.sroa.8.0._0.sroa_idx, align 1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           47:  ret void 
check:15'0     ~~~~~~~~~~
           48: } 
check:15'0     ~~
check:15'0     ~
check:15'0     ~
           50: ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           51: declare i16 @llvm.bswap.i16(i16) #1 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:15'0     ~
check:15'0     ~
           53: attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) "target-cpu"="generic" } 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           54: attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:15'0     ~
check:15'0     ~
           56: !llvm.ident = !{!0} 
check:15'0     ~~~~~~~~~~~~~~~~~~~~
check:15'0     ~
check:15'0     ~
           58: !0 = !{!"rustc version 1.86.0-nightly (bd68693b6 2025-02-11)"} 
check:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           59: !1 = !{} 
check:15'0     ~~~~~~~~~
------------------------------------------



@bors
Copy link
Contributor

bors commented Feb 11, 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 Feb 11, 2025
@jieyouxu
Copy link
Member

#136761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-solid Operating System: SOLID 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants