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 8 pull requests #121320

Closed
wants to merge 17 commits into from
Closed

Conversation

saethlin
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

nnethercote and others added 17 commits February 17, 2024 09:40
`CompilerError` has `CompilationFailed` and `ICE` variants, which seems
reasonable at first. But the way it identifies them is flawed:
- If compilation errors out, i.e. `RunCompiler::run` returns an `Err`,
  it uses `CompilationFailed`, which is reasonable.
- If compilation panics with `FatalError`, it catches the panic and uses
  `ICE`. This is sometimes right, because ICEs do cause `FatalError`
  panics, but sometimes wrong, because certain compiler errors also
  cause `FatalError` panics. (The compiler/rustdoc/clippy/whatever just
  catches the `FatalError` with `catch_with_exit_code` in `main`.)

In other words, certain non-ICE compilation failures get miscategorized
as ICEs. It's not possible to reliably distinguish the two cases, so
this commit merges them. It also renames the combined variant as just
`Failed`, to better match the existing `Interrupted` and `Skipped`
variants.

Here is an example of a non-ICE failure that causes a `FatalError`
panic, from `tests/ui/recursion_limit/issue-105700.rs`:
```
 #![recursion_limit="4"]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 //~^ERROR recursion limit reached while expanding

 fn main() {{}}
```
When these extra directives were ported over as part of rust-lang#112300, it made sense
to introduce `iter_header_extra` and pass them in as an extra argument.

But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own
purposes, it's slightly simpler to move the coverage special-case code directly
into `iter_header` as well. This lets us get rid of `iter_header_extra`.
Noticed these while doing something else. There's no practical change, but it's preferable to use `DUMMY_SP` as little as possible, particularly when we have perfectlly useful `Span`s available.
It showed up with 3% execution time in a compiler profile.
…nethercote

Add "algebraic" fast-math intrinsics, based on fast-math ops that cannot return poison

Setting all of LLVM's fast-math flags makes our fast-math intrinsics very dangerous, because some inputs are UB. This set of flags permits common algebraic transformations, but according to the [LangRef](https://llvm.org/docs/LangRef.html#fastmath), only the flags `nnan` (no nans) and `ninf` (no infs) can produce poison.

And this uses the algebraic float ops to fix rust-lang#120720

cc `@orlp`
unstable-book: Separate testing and production sanitizers

This is a redo of [this PR](rust-lang#108942). Left the commit as before (except for reflowing to 80-width), since it already got approved.
…rError, r=oli-obk

Merge `CompilerError::CompilationFailed` and `CompilerError::ICE`.

`CompilerError` has `CompilationFailed` and `ICE` variants, which seems reasonable at first. But the way it identifies them is flawed:
- If compilation errors out, i.e. `RunCompiler::run` returns an `Err`, it uses `CompilationFailed`, which is reasonable.
- If compilation panics with `FatalError`, it catches the panic and uses `ICE`. This is sometimes right, because ICEs do cause `FatalError` panics, but sometimes wrong, because certain compiler errors also cause `FatalError` panics. (The compiler/rustdoc/clippy/whatever just catches the `FatalError` with `catch_with_exit_code` in `main`.)

In other words, certain non-ICE compilation failures get miscategorized as ICEs. It's not possible to reliably distinguish the two cases, so this commit merges them. It also renames the combined variant as just `Failed`, to better match the existing `Interrupted` and `Skipped` variants.

Here is an example of a non-ICE failure that causes a `FatalError` panic, from `tests/ui/recursion_limit/issue-105700.rs`:
```
 #![recursion_limit="4"]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 //~^ERROR recursion limit reached while expanding

 fn main() {{}}
```

r? `@spastorino`
Move the extra directives for `Mode::CoverageRun` into `iter_header`

When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument.

But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
Allow AST and HIR visitors to return `ControlFlow`

Alternative to rust-lang#108598.

Since rust-lang/libs-team#187 was rejected, this implements our own version of the `Try` trait (`VisitorResult`) and the `try` macro (`try_visit`). Since this change still allows visitors to return `()`, no changes have been made to the existing ones. They can be done in a separate PR.
Drive-by `DUMMY_SP` -> `Span` and fmt changes

Noticed these while doing something else. There's no practical change, but it's preferable to use `DUMMY_SP` as little as possible, particularly when we have perfectlly useful `Span`s available.
…rieb

Remove an old hack for rustdoc

Since rust-lang#78696 has been resolved
…thlin

Make `is_nonoverlapping` `#[inline]`

It showed up with 3% execution time in a compiler profile.

backlink to rust-lang#120848

r? `@saethlin`
@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-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 20, 2024
@saethlin
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Feb 20, 2024

📌 Commit 6544ba2 has been approved by saethlin

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 Feb 20, 2024
@bors
Copy link
Contributor

bors commented Feb 20, 2024

⌛ Testing commit 6544ba2 with merge 236a550...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 20, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#120718 (Add "algebraic" fast-math intrinsics, based on fast-math ops that cannot return poison)
 - rust-lang#121195 (unstable-book: Separate testing and production sanitizers)
 - rust-lang#121205 (Merge `CompilerError::CompilationFailed` and `CompilerError::ICE`.)
 - rust-lang#121233 (Move the extra directives for `Mode::CoverageRun` into `iter_header`)
 - rust-lang#121256 (Allow AST and HIR visitors to return `ControlFlow`)
 - rust-lang#121307 (Drive-by `DUMMY_SP` -> `Span` and fmt changes)
 - rust-lang#121310 (Remove an old hack for rustdoc)
 - rust-lang#121311 (Make `is_nonoverlapping` `#[inline]`)

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)
---- [codegen] tests/codegen/simd/issue-120720-reduce-nan.rs stdout ----

error: compilation failed!
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/codegen/simd/issue-120720-reduce-nan.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=wasm32-unknown-unknown" "-O" "--emit" "llvm-ir" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/simd/issue-120720-reduce-nan/issue-120720-reduce-nan.ll" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/simd/issue-120720-reduce-nan/auxiliary"
--- stderr -------------------------------
error[E0432]: unresolved import `std::arch::x86_64`
##[error] --> /checkout/tests/codegen/simd/issue-120720-reduce-nan.rs:8:16
  |
  |
8 | use std::arch::x86_64::*;
  |                ^^^^^^ could not find `x86_64` in `arch`

error[E0635]: unknown feature `stdarch_x86_avx512`
##[error] --> /checkout/tests/codegen/simd/issue-120720-reduce-nan.rs:7:12
  |
7 | #![feature(stdarch_x86_avx512, avx512_target_feature)]


error: the feature named `avx512f` is not valid for this target
##[error]  --> /checkout/tests/codegen/simd/issue-120720-reduce-nan.rs:12:18
   |
12 | #[target_feature(enable = "avx512f")] // Function-level target feature mismatches inhibit inlining
   |                  ^^^^^^^^^^^^^^^^^^ `avx512f` is not valid for this target

error[E0425]: cannot find function `_mm512_set_pd` in this scope
##[error]  --> /checkout/tests/codegen/simd/issue-120720-reduce-nan.rs:18:30
   |
18 |         _mm512_reduce_add_pd(_mm512_set_pd(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, f64::NAN))


error[E0425]: cannot find function `_mm512_reduce_add_pd` in this scope
##[error]  --> /checkout/tests/codegen/simd/issue-120720-reduce-nan.rs:18:9
   |
18 |         _mm512_reduce_add_pd(_mm512_set_pd(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, f64::NAN))

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0425, E0432, E0635.

@bors
Copy link
Contributor

bors commented Feb 20, 2024

💔 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 20, 2024
@saethlin saethlin closed this Feb 20, 2024
@saethlin saethlin deleted the rollup-x1x4toc branch February 20, 2024 05:03
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 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.

10 participants