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 9 pull requests #94151

Closed
wants to merge 22 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

m-ou-se and others added 22 commits February 4, 2022 12:27
No functional changes intended.

This updates the test case to use llvm-nm instead of the system nm.
This fixes an instance over at the experimental build of rustc with HEAD LLVM:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/8380#ef6f41b5-8595-49a6-be37-0eff80e0ccb5
It is related to rust-lang#94001.

The issue is that this test uses the system nm, which may not be recent
enough to understand the update to uwtable. This replaces the test to
use the llvm-nm that should be recent enough (consistent with the LLVM
sources we use to build rustc).
This issue was found by the Wine project and mitigated there [1].

Windows' setsockopt expects a BOOL (a typedef for int) for TCP_NODELAY
[2]. Windows itself is forgiving and will accept any positive optlen and
interpret the first byte of *optval as the value, so this bug does not
affect Windows itself, but does affect systems implementing Windows'
interface more strictly, such as Wine. Wine was previously passing this
through to the host's setsockopt, where, e.g., Linux requires that
optlen be correct for the chosen option, and TCP_NODELAY expects an int.

[1]: https://source.winehq.org/git/wine.git/commit/d6ea38f32dfd3edbe107a255c37e9f7f3da06ae7
[2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-setsockopt
Co-authored-by: Jubilee Young <workingjubilee@gmail.com>
The optimization was proposed by @falk-hueffner in https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Micro-optimizing.20char.3A.3Afrom_u32/near/272146171,  and I simplified it a bit and added an explanation of why the optimization is correct.
…iplett

core: Implement ASCII trim functions on byte slices

Hi ``@rust-lang/libs!`` This is a feature that I wished for when implementing serial protocols with microcontrollers. Often these protocols may contain leading or trailing whitespace, which needs to be removed. Because oftentimes drivers will operate on the byte level, decoding to unicode and checking for unicode whitespace is unnecessary overhead.

This PR adds three new methods to byte slices:

- `trim_ascii_start`
- `trim_ascii_end`
- `trim_ascii`

I did not find any pre-existing discussions about this, which surprises me a bit. Maybe I'm missing something, and this functionality is already possible through other means? There's rust-lang/rfcs#2547 ("Trim methods on slices"), but that has a different purpose.

As per the [std dev guide](https://std-dev-guide.rust-lang.org/feature-lifecycle/new-unstable-features.html), this is a proposed implementation without any issue / RFC. If this is the wrong process, please let me know. However, I thought discussing code is easier than discussing a mere idea, and hacking on the stdlib was fun.

Tracking issue: rust-lang#94035
…acro, r=notriddle

rustdoc: Avoid duplicating macros in sidebar

Fixes rust-lang#93912.

cc `@jsha` (for the GUI test)
r? `@camelid`
…=Mark-Simulacrum

adapt static-nobundle test to use llvm-nm

No functional changes intended.

This updates the test case to use llvm-nm instead of the system nm.
This fixes an instance over at the experimental build of rustc with HEAD LLVM:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/8380#ef6f41b5-8595-49a6-be37-0eff80e0ccb5
It is related to rust-lang#94001.

The issue is that this test uses the system nm, which may not be recent
enough to understand the update to uwtable. This replaces the test to
use the llvm-nm that should be recent enough (consistent with the LLVM
sources we use to build rustc).
…crum

Update libc to 0.2.118

Updating libc to 0.2.118 adds platform support for m68k-unknown-linux-gnu.
…=dtolnay

use BOOL for TCP_NODELAY setsockopt value on Windows

This issue was found by the Wine project and mitigated there [^1].

Windows' setsockopt expects a BOOL (a typedef for int) for TCP_NODELAY
[^2]. Windows itself is forgiving and will accept any positive optlen and
interpret the first byte of *optval as the value, so this bug does not
affect Windows itself, but does affect systems implementing Windows'
interface more strictly, such as Wine. Wine was previously passing this
through to the host's setsockopt, where, e.g., Linux requires that
optlen be correct for the chosen option, and TCP_NODELAY expects an int.

[^1]: https://source.winehq.org/git/wine.git/commit/d6ea38f32dfd3edbe107a255c37e9f7f3da06ae7
[^2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-setsockopt
Optimize char_try_from_u32

The optimization was proposed by `@falk-hueffner` in https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Micro-optimizing.20char.3A.3Afrom_u32/near/272146171,  and I simplified it a bit and added an explanation of why the optimization is correct. The generated code is 2 instructions shorter and uses 2 registers instead of 4 on x86.
…otriddle

Fix miniz_oxide types showing up in std docs

Fixes rust-lang#90526.

Thanks to `@camelid,` I rediscovered `doc(masked)`, allowing us to prevent `miniz_oxide` type to show up in std docs.

r? `@notriddle`
@rustbot rustbot added T-compiler Relevant to the compiler 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. rollup A PR which is a rollup labels Feb 19, 2022
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Feb 19, 2022

📌 Commit 1160ea2 has been approved by matthiaskrgr

@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 19, 2022
@bors
Copy link
Contributor

bors commented Feb 19, 2022

⌛ Testing commit 1160ea2 with merge a54000e1c5093e09add474b53ec6c1ff09485d5e...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] core test:false 15.837
[RUSTC-TIMING] addr2line test:false 0.354
[RUSTC-TIMING] gimli test:false 3.870
[RUSTC-TIMING] object test:false 3.974
error: linking with `sparcv9-sun-solaris2.10-gcc` failed: exit status: 1
  |
  = note: "sparcv9-sun-solaris2.10-gcc" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/std-47c43ea680693f72.std.dbbadde4-cgu.0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/std-47c43ea680693f72.1rahvymwwel2as3o.rcgu.rmeta" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/std-47c43ea680693f72.47qtcd4dwrokqs22.rcgu.o" "-Wl,-z,ignore" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/release/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/build/compiler_builtins-5716f7ef6895ed0e/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/sparcv9-sun-solaris/lib" "-lsocket" "-lposix4" "-lpthread" "-lresolv" "-Wl,-Bstatic" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libpanic_unwind-bb0f7550c2362890.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libobject-889d4a9fb2110a8c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libmemchr-4468d32461911ddd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libaddr2line-954d37d8eb8c264d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libgimli-636fae382c83a9d9.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/librustc_demangle-1f21bbdd3b7bf189.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libstd_detect-185b3857bc4ce2fd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libhashbrown-95e56f0343b0bdea.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libminiz_oxide-dda91d6daca3da14.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libadler-bf7eeec126c736bd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/librustc_std_workspace_alloc-24003946e20acadc.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libunwind-e04a3e19b1d7eb47.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libcfg_if-59059f45e2b08927.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/liblibc-a1c68e469b5762d2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/liballoc-b52962fa1a72c80b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/librustc_std_workspace_core-f9201a16360d7390.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libcore-084d6dec6a6b8054.rlib" "-Wl,--no-whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libcompiler_builtins-e2bc021920d3eb95.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lsendfile" "-llgrp" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/sparcv9-sun-solaris/lib" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/sparcv9-sun-solaris/release/deps/libstd-47c43ea680693f72.so" "-shared" "-nodefaultlibs" "-Wl,-z,origin" "-Wl,-rpath,$ORIGIN/../lib"
  = note: /usr/local/lib/gcc/sparcv9-sun-solaris2.10/6.5.0/../../../../sparcv9-sun-solaris2.10/bin/ld: warning: -z ignore ignored.
          /usr/local/lib/gcc/sparcv9-sun-solaris2.10/6.5.0/../../../../sparcv9-sun-solaris2.10/bin/ld: cannot find -lsendfile
          /usr/local/lib/gcc/sparcv9-sun-solaris2.10/6.5.0/../../../../sparcv9-sun-solaris2.10/bin/ld: cannot find -llgrp
          collect2: error: ld returned 1 exit status

[RUSTC-TIMING] std test:false 19.561
error: could not compile `std` due to previous error
Build completed unsuccessfully in 0:15:04

@bors
Copy link
Contributor

bors commented Feb 19, 2022

💔 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 19, 2022
@matthiaskrgr matthiaskrgr deleted the rollup-yyevpyo branch March 11, 2022 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet