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 10 pull requests #109497

Merged
merged 23 commits into from
Mar 23, 2023
Merged

Rollup of 10 pull requests #109497

merged 23 commits into from
Mar 23, 2023

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

cbeuw and others added 23 commits March 20, 2023 12:21
This option was added to LLVM in
https://reviews.llvm.org/D121750?id=416339. It makes `llvm_unreachable`
in builds without assertions compile to an `LLVM_BUILTIN_TRAP` instead
of `LLVM_BUILTIN_UNREACHABLE` (which causes undefined behavior and is
equivalent to `std::hint::unreachable_unchecked`).

Having compiler bugs triggering undefined behavior generally seems
undesirable and inconsistent with Rust's goals. There is a check in
`src/tools/tidy/src/style.rs` to reject code using `llvm_unreachable`.
But it is used a lot within LLVM itself.

For instance, this changes a failure I get compiling `libcore` for m68k
from a `SIGSEGV` to `SIGILL`, which seems better though it still doesn't
provide a useful message without switching to an LLVM build with asserts.

It may be best not to do this if it noticeably degrades compiler
performance, but worthwhile if it doesn't do so in any significant way. I
haven't looked into what benchmarks there are for Rustc. That should be
considered before merging.
When running `x.py test` on a downloaded source distribution (e.g.
https://static.rust-lang.org/dist/rustc-<version>-src.tar.gz), the
crates in the vendor directory contain a number of executable files that
cause the tidy test to fail with the following message:

tidy error: binary checked into source: <path>

I see 26 such errors with the 1.68.0 source distribution. A few of these
are .rs source files with incorrect executable permission, but most are
scripts that are correctly marked executable.
Reverts a1d4ebe, as well as
fixing the problem it solved with links losing their color.
This avoids repetition
… r=ozkanonur

Set LLVM `LLVM_UNREACHABLE_OPTIMIZE` to `OFF`

This option was added to LLVM in https://reviews.llvm.org/D121750?id=416339. It makes `llvm_unreachable` in builds without assertions compile to an `LLVM_BUILTIN_TRAP` instead of `LLVM_BUILTIN_UNREACHABLE` (which causes undefined behavior and is equivalent to `std::hint::unreachable_unchecked`).

Having compiler bugs triggering undefined behavior generally seems undesirable and inconsistent with Rust's goals. There is a check in `src/tools/tidy/src/style.rs` to reject code using `llvm_unreachable`. But it is used a lot within LLVM itself.

For instance, this changes a failure I get compiling `libcore` for m68k from a `SIGSEGV` to `SIGILL`, which seems better though it still doesn't provide a useful message without switching to an LLVM build with asserts.

It may be best not to do this if it noticeably degrades compiler performance, but worthwhile if it doesn't do so in any significant way. I haven't looked into what benchmarks there are for Rustc. That should be considered before merging.
Custom MIR: Allow optional RET type annotation

This currently doesn't compile because the type of `RET` is inferred, which fails if RET is a composite type and fields are initialised separately.
```rust
#![feature(custom_mir, core_intrinsics)]
extern crate core;
use core::intrinsics::mir::*;
#[custom_mir(dialect = "runtime", phase = "optimized")]
fn fn0() -> (i32, bool) {
    mir! ({
        RET.0 = 0;
        RET.1 = true;
        Return()
    })
}
```
```
error[E0282]: type annotations needed
 --> src/lib.rs:8:9
  |
8 |         RET.0 = 0;
  |         ^^^ cannot infer type

For more information about this error, try `rustc --explain E0282`.
```

This PR allows the user to manually specify the return type with `type RET = ...;` if required:

```rust
#[custom_mir(dialect = "runtime", phase = "optimized")]
fn fn0() -> (i32, bool) {
    mir! (
        type RET = (i32, bool);
        {
            RET.0 = 0;
            RET.1 = true;
            Return()
        }
    )
}
```

The syntax is not optimal, I'm happy to see other suggestions. Ideally I wanted it to be a normal type annotation like `let RET: ...;`, but this runs into the multiple parsing options error during macro expansion, as it can be parsed as a normal `let` declaration as well.

r? ```@oli-obk``` or ```@tmiasko``` or ```@JakobDegen```
…riddle

rustdoc: Add GUI test for "Auto-hide item contents for large items" setting

Part of rust-lang#66181.

The `browser-ui-test` version update is because there wasn't `null` check for attributes so I added it (PR is [here](GuillaumeGomez/browser-UI-test#440)).

r? ``@notriddle``
Ignore the vendor directory for tidy tests.

When running `x.py test` on a downloaded source distribution (e.g. https://static.rust-lang.org/dist/rustc-<version>-src.tar.gz), the crates in the vendor directory contain a number of executable files that cause the tidy test to fail with the following message:

tidy error: binary checked into source: <path>

I see 26 such errors with the 1.68.0 source distribution. A few of these are .rs source files with incorrect executable permission, but most are scripts that are correctly marked executable.
Remove comment about reusing rib allocations

Perf indicates this to not be worth the complexity

cc rust-lang#4948
…=GuillaumeGomez

rustdoc: remove redundant `.content` prefix from span/a colors

Reverts a1d4ebe, as well as fixing the problem it solved with links losing their color.
`HirId` to `LocalDefId` cleanup

revival of the still relevant parts of rust-lang#109125
…eLapkin

More general captures

This avoids repetition of the binding.
…er-errors

Do not feed param_env for RPITITs impl side

r? `@compiler-errors`

I don't think this needs more comments or things that we already have but please let me know if you want some comments or something else in this PR.
@rustbot rustbot added 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-infra Relevant to the infrastructure 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. labels Mar 22, 2023
@rustbot rustbot added the rollup A PR which is a rollup label Mar 22, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=10

@bors
Copy link
Contributor

bors commented Mar 22, 2023

📌 Commit 6244b94 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 22, 2023
@bors
Copy link
Contributor

bors commented Mar 22, 2023

⌛ Testing commit 6244b94 with merge 8859fde...

@bors
Copy link
Contributor

bors commented Mar 23, 2023

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 8859fde to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Mar 23, 2023

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 8859fde to master...

@bors bors added merged-by-bors This PR was explicitly merged by bors. labels Mar 23, 2023
@bors bors merged commit 8859fde into rust-lang:master Mar 23, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha

previous master: 8859fde21f

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rustbot rustbot added this to the 1.70.0 milestone Mar 23, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8859fde): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.8% [0.4%, 2.1%] 6
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
-0.6% [-0.6%, -0.6%] 1
All ❌✅ (primary) -2.3% [-2.3%, -2.3%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.0% [0.8%, 1.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.4%] 2
All ❌✅ (primary) - - 0

@matthiaskrgr matthiaskrgr deleted the rollup-6txuxm0 branch March 16, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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-infra Relevant to the infrastructure 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.