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 #109230

Closed
wants to merge 34 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

thomcc and others added 30 commits March 12, 2023 00:23
Hide invalid proc-macro suggestions and track spans
coming from proc-macros pointing at attribute.

Effectively, unless the proc-macro keeps user spans,
suggestions will not be produced for the code they
produce.

Account for desugaring when checking if a span can be used for suggestions

Fix rust-lang#106720.
This test was failing under new-symbol-mangling = true. Adapt pattern to
work in both cases.

Related to rust-lang#106002 from December.
I went over the cases where sort_by is used and in these two,
one can use sort_by_key instead.
…r-errors

Remove box expressions from HIR

After rust-lang#108516, `#[rustc_box]` is used at HIR->THIR lowering and this is no longer emitted, so it can be removed.

This is based on top of rust-lang#108471 to help with conflicts, so 43490488ccacd1a822e9c621f5ed6fca99959a0b is the only relevant commit (sorry for all the duplicated pings!)

`@rustbot` label +S-blocked
Change text -> rust highlighting in sanitizer.md

Not sure why this has syntax highlighting turned off, but it doesn't need to be

Relevant page: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html
…r=jyn514

Prevent stable `libtest` from supporting `-Zunstable-options`

Took a while for me to get around to this but seems trivial (unless I'm missing some reason this will break all our tests). Fixes rust-lang#75526

Basically `libtest` already tries to handle this in https://github.com/rust-lang/rust/blob/501ad021b9a4fb2cd6a39e0302d22f169f6166b0/library/test/src/cli.rs#L310-L318

But that env var was not passed. I'm guessing at one point [this code](https://github.com/rust-lang/rust/blob/501ad021b9a4fb2cd6a39e0302d22f169f6166b0/src/bootstrap/compile.rs#L842-L844) (or a common ancestor) was used to compile the standard library/libtest, but that is no longer the case (or perhaps it never worked, I don't have time to go digging).

I don't love that this is a "allow unstable by default" situation, as it means things like [`rustc-build-sysroot`](https://github.com/RalfJung/rustc-build-sysroot) could accidentally get unstable (CC `@RalfJung)` even if this is fixed here, but it's consistent with what happens in `rustc_feature`, so... yeah.

This is user-facing after all, even if it's hard to imagine the outcome of that conversation being "lets continue allowing use of `-Zunstable-features` from stable rust" (especially since a `RUSTC_BOOTSTRAP=1`-shaped loophole remains)... I think it probably should get a vibe check in the t-libs meeting (and plausibly a relnote along the lines of "hey `cargo test -- -Zunstable-options --some --unstable --stuff=here` used to work on stable, that's been fixed, sorry").

I'll nominate it for that after CI comes up green (I've done a smoke check but don't know what (if anything) will need `bootstrap` to enable `RUSTC_BOOTSTRAP=1` when running tests)

r? `@jyn514`
Do not provide suggestions when the spans come from expanded code that doesn't point at user code

Hide invalid proc-macro suggestions and track spans
coming from proc-macros pointing at attribute.

Effectively, unless the proc-macro keeps user spans,
suggestions will not be produced for the code they
produce.

r? `@ghost`

Fix rust-lang#107113, fix rust-lang#107976, fix rust-lang#107977, fix rust-lang#108748, fix rust-lang#106720, fix rust-lang#90557.

Could potentially address rust-lang#50141, rust-lang#67373, rust-lang#55146, rust-lang#78862, rust-lang#74043, rust-lang#88514, rust-lang#83320, rust-lang#91520, rust-lang#104071. CC rust-lang#50122, rust-lang#76360.
…arget, r=tmandry

Fix riscv64 fuchsia LLVM target name

Currently, riscv64gc-unknown-fuchsia (added in rust-lang#108722) sets riscv64*gc*-unknown-fuchsia as the LLVM target.

https://github.com/rust-lang/rust/blob/1716932743a7b3705cbf0c34db0c4e070ed1930d/compiler/rustc_target/src/spec/riscv64gc_unknown_fuchsia.rs#L5

However, riscv64*gc*-\* is not a valid LLVM target and causes the following error.

```console
$ rustc --print cfg --target riscv64gc-unknown-fuchsia
error: could not create LLVM TargetMachine for triple: riscv64gc-unknown-fuchsia: No available targets are compatible with triple "riscv64gc-unknown-fuchsia"
```

As with other RISC-V targets, the LLVM target should use riscv64-\*, not riscv64*gc*-\*.

https://github.com/rust-lang/rust/blob/1716932743a7b3705cbf0c34db0c4e070ed1930d/compiler/rustc_target/src/spec/riscv64gc_unknown_freebsd.rs#L5
https://github.com/rust-lang/rust/blob/1716932743a7b3705cbf0c34db0c4e070ed1930d/compiler/rustc_target/src/spec/riscv64gc_unknown_linux_gnu.rs#L5

I confirmed that riscv64-unknown-fuchsia is recognized as a valid LLVM target by using custom targets.

```console
# create a custom target with `"llvm-target": "riscv64-unknown-fuchsia" from no-std riscv64gc target.
$ rustc --print target-spec-json -Z unstable-options --target riscv64gc-unknown-none-elf | grep -v is-builtin | sed 's/"llvm-target".*/"llvm-target": "riscv64-unknown-fuchsia",/' > riscv64gc-unknown-fuchsia.json

$ rustc --print cfg --target riscv64gc-unknown-fuchsia.json
debug_assertions
panic="abort"
target_abi=""
target_arch="riscv64"
target_endian="little"
target_env=""
target_feature="a"
target_feature="c"
target_feature="d"
target_feature="f"
target_feature="m"
...

$ cat riscv64gc-unknown-fuchsia.json
{
  "arch": "riscv64",
  "code-model": "medium",
  "cpu": "generic-rv64",
  "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
  "eh-frame-header": false,
  "emit-debug-gdb-scripts": false,
  "features": "+m,+a,+f,+d,+c",
  "linker": "rust-lld",
  "linker-flavor": "ld.lld",
  "llvm-abiname": "lp64d",
  "llvm-target": "riscv64-unknown-fuchsia",
  "max-atomic-width": 64,
  "panic-strategy": "abort",
  "relocation-model": "static",
  "supported-sanitizers": [
    "kernel-address"
  ],
  "target-pointer-width": "64"
}

# Check the current master's LLVM target name causes an error
$ sed -i 's/riscv64-unknown-fuchsia/riscv64gc-unknown-fuchsia/' riscv64gc-unknown-fuchsia.json
$ rustc --print cfg --target riscv64gc-unknown-fuchsia.json
error: could not create LLVM TargetMachine for triple: riscv64gc-unknown-fuchsia: No available targets are compatible with triple "riscv64gc-unknown-fuchsia"
```

r? `@tmandry`
…henkov

Fix linker detection for clang with prefix

rust-lang#106489 removed check for clang with prefix. It says:

> Also remove the check for -clang, since there are no architecture specific variants of clang (to my knowledge).

However, when doing cross-compilation, a wrapper script for clang with the target name as a prefix is sometimes used.

https://github.com/rust-lang/rust/blob/1716932743a7b3705cbf0c34db0c4e070ed1930d/src/ci/docker/host-x86_64/dist-various-2/Dockerfile#L62

https://github.com/rust-lang/rust/blob/1716932743a7b3705cbf0c34db0c4e070ed1930d/src/ci/docker/scripts/freebsd-toolchain.sh#L76-L80

https://github.com/rust-lang/rust/blob/1716932743a7b3705cbf0c34db0c4e070ed1930d/src/ci/docker/host-x86_64/dist-various-2/Dockerfile#L40

https://github.com/rust-lang/rust/blob/1716932743a7b3705cbf0c34db0c4e070ed1930d/compiler/rustc_target/src/spec/aarch64_pc_windows_gnullvm.rs#L7

It seems the regression did not occur on the targets mentioned above because the default linker flavor is gcc, but it did occur on targets where the default linker flavor is not gcc (taiki-e/setup-cross-toolchain-action@fd352f3).

r? `@petrochenkov`
…, r=Nilstrieb

inherit_overflow: adapt pattern to also work with v0 mangling

This test was failing under new-symbol-mangling = true. Adapt pattern to work in both cases.

Related to rust-lang#106002 from December.
…-body, r=spastorino

Install projection from RPITIT to default trait method opaque correctly

1. For new lowering strategy `-Zlower-impl-trait-in-trait-to-assoc-ty`, install the correct default trait method projection predicates (RPITIT -> opaque). This makes default trait body tests pass!

2. Fix two WF-checking bugs -- first, we want to make sure that we're always looking for an opaque type in `check_return_position_impl_trait_in_trait_bounds`. That's because the RPITIT projections are normalized to opaques during wfcheck. Second, fix RPITIT's param-envs by not adding the projection predicates that we install on trait methods to make default RPITITs work -- I left a comment why.

3. Also, just a small drive-by for `rustc_on_unimplemented`. Not sure if it affects any tests, but can't hurt.

r? `@spastorino,` based off of rust-lang#109140
Use sort_by_key instead of sort_by

I went over the cases where sort_by is used and in these two, one can use sort_by_key instead.
@rustbot rustbot added 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Mar 16, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Mar 16, 2023

📌 Commit 686e832 has been approved by matthiaskrgr

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 Mar 16, 2023
@bors
Copy link
Contributor

bors commented Mar 16, 2023

⌛ Testing commit 686e832 with merge 50e383c3c34f7eb7d99dd6c6d08fd2f2bc4d133d...

@bors
Copy link
Contributor

bors commented Mar 16, 2023

💔 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 Mar 16, 2023
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
---- D:\a\rust\rust\src/doc/unstable-book\src\compiler-flags\sanitizer.md - ControlFlowIntegrity::Example (line 216) stdout ----
Test executable failed (exit code: 101).

stdout:
The answer is: 12
With CFI enabled, you should not see the next answer
stderr:
thread 'main' panicked at 'attempt to add with overflow', D:\a\rust\rust\src/doc/unstable-book\src\compiler-flags\sanitizer.md:37:5
stack backtrace:
   0:     0x7ff7522f96fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1c8bee8166ca2dee
   0:     0x7ff7522f96fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1c8bee8166ca2dee
   1:     0x7ff75230a708 - core::fmt::write::h11e849286d137000
   2:     0x7ff7522f7559 - std::io::stdio::_print::h21442c8313c32316
   3:     0x7ff7522f94ab - std::sys::common::alloc::realloc_fallback::hd68a4caebe063ddf
   4:     0x7ff7522fb8f5 - std::panicking::default_hook::h5b7dbf6749bd40bb
   5:     0x7ff7522fb4f0 - std::panicking::default_hook::h5b7dbf6749bd40bb
   6:     0x7ff7522fbe31 - std::panicking::rust_panic_with_hook::hd1cc9fe64f43d699
   7:     0x7ff7522fbccb - <std::panicking::begin_panic_handler::StrPanicPayload as core::panic::BoxMeUp>::get::h54705c3da9648eba
   8:     0x7ff7522fa0f9 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1c8bee8166ca2dee
   9:     0x7ff7522fb980 - rust_begin_unwind
  10:     0x7ff752310d45 - core::panicking::panic_fmt::h5df626a21a13d6ff
  11:     0x7ff752310dfc - core::panicking::panic::h5034edfcf3432d22
  12:     0x7ff7522f13cb - std::rt::lang_start::h9a691f139a8479f3
  13:     0x7ff7522f1485 - std::rt::lang_start::h9a691f139a8479f3
  14:     0x7ff7522f12a6 - std::rt::lang_start::h9a691f139a8479f3
  15:     0x7ff7522f1009 - __ImageBase
  16:     0x7ff7522f105c - std::rt::lang_start::h9a691f139a8479f3
  17:     0x7ff7522f47f1 - std::rt::lang_start_internal::h3e7f5970900b3191
  18:     0x7ff7522f1037 - std::rt::lang_start::h9a691f139a8479f3
  19:     0x7ff7522f1509 - main
  20:     0x7ff75230ed7c - invoke_main
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  21:     0x7ff75230ed7c - __scrt_common_main_seh
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  22:     0x7ffc0ad37ad4 - BaseThreadInitThunk
  23:     0x7ffc0bc0a371 - RtlUserThreadStart


failures:
    D:\a\rust\rust\src/doc/unstable-book\src\compiler-flags\sanitizer.md - ControlFlowIntegrity::Example (line 216)
    D:\a\rust\rust\src/doc/unstable-book\src\compiler-flags\sanitizer.md - ControlFlowIntegrity::Example (line 216)

test result: FAILED. 7 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.45s

Build completed unsuccessfully in 0:58:05
make: *** [Makefile:68: ci-subset-1] Error 1

@matthiaskrgr matthiaskrgr deleted the rollup-rknjjir branch March 16, 2024 18:19
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-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-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.