Commit Graph

247091 Commits

Author SHA1 Message Date
bors
f62f490fd4 Auto merge of #121370 - jieyouxu:migrate-compiletest-directives, r=oli-obk
Migrate compiletest to use `ui_test`-style `//@` directives

## Preface

There's an on-going effort to rewrite parts of or the entirety of compiletest
(<https://github.com/rust-lang/compiler-team/issues/536>). A step towards this involve migrating
compiletest tests to use the [`ui_test`](https://github.com/oli-obk/ui_test) framework, which
involves changing compiletest directives in `// <directive-name>` style to `ui_test`
`//@ <directive-name>` style (https://github.com/rust-lang/compiler-team/issues/512).

This PR aims to implement the directive-style change from `//` to `//`@`` for the remaining
non-"ui" test suite tests.

## Key Changes

1. All `tests/` tests now use `//`@`` directives.
2. Compiletest only accepts `//`@`` and issues an error if an old-style directive is detected.
3. `// ignore-tidy` and `// ignore-tidy-*` are considered tidy directives and are ignored by
   compiletest header parsing.

## Diff Generation

The diff is generated by:

- Collecting directives from `tests/` via hijacking compiletest to emit successfully parsed
  directive lines.
- Using a migration tool
  (<https://github.com/jieyouxu/compiletest-ui_test-header-migration/tree/master>) to replace
  `//` directives in compiletest tests with `//`@`.`

### Reproduction Steps

0. Delete the temporary file `$RUSTC_REPO_PATH/build/<target_triple>/test/__directive_lines.txt`,
   if the collection script was previously ran.
1. Use the <https://github.com/jieyouxu/rust/tree/collect-test-directives> collect-test-directives
   script, which outputs a temporary file recording headers occuring in each compiletest test.
   - You need to checkout this branch: `git checkout collect-test-directives`.
   - This needs to be rebased on latest master to ensure up-to-date test directives can be collected.
   - You need to run `./x test` on each of the `test/*` subfolders once:

        ```bash
        ./x test tests/assembly/ --stage 1 --force-rerun
        ./x test tests/codegen/ --stage 1 --force-rerun
        ./x test tests/codegen-units/ --stage 1 --force-rerun
        ./x test tests/coverage/ --stage 1 --force-rerun
        ./x test tests/coverage-run-rustdoc/ --stage 1 --force-rerun
        ./x test tests/debuginfo/ --stage 1 --force-rerun
        ./x test tests/incremental/ --stage 1 --force-rerun
        ./x test tests/mir-opt/ --stage 1 --force-rerun
        ./x test tests/pretty/ --stage 1 --force-rerun
        ./x test tests/run-make/ --stage 1 --force-rerun
        ./x test tests/run-make-fulldeps/ --stage 1 --force-rerun
        ./x test tests/run-pass-valgrind/ --stage 1 --force-rerun
        ./x test tests/rustdoc/ --stage 1 --force-rerun
        TARGET=<target-triple> ./x test tests/rustdoc-gui/ --stage 1 --force-rerun
        ./x test tests/rustdoc-js/ --stage 1 --force-rerun
        ./x test tests/rustdoc-js-std/ --stage 1 --force-rerun
        ./x test tests/rustdoc-json/ --stage 1 --force-rerun
        ./x test tests/rustdoc-ui/ --stage 1 --force-rerun
        ./x test tests/ui/ --stage 1 --force-rerun
        ./x test tests/ui-fulldeps/ --stage 1 --force-rerun
        ```

2. Checkout the `migrate-compiletest-directives` branch.
3. Run the migration tool <https://github.com/jieyouxu/compiletest-ui_test-header-migration>.
4. Check that the migration at least does not cause test failures if you change compiletest to
   accept `//`@`` directives only. This is also required if the test outputs somehow need to be
   blessed.
   - `RUSTC_TEST_FAIL_FAST=1 ./x test tests/<secondary-directory>  --stage 1 --bless`
5. Confirm that there is no difference after running the migration tool when you are on the
   `migrate-compiletest-directives` branch.

## Follow Up Work

- [ ] Adjust rustc-dev-guide docs for compiletest directives (this time for all the other suites and modes). <https://github.com/rust-lang/rustc-dev-guide/pull/1895>.
2024-02-22 16:39:09 +00:00
lcnr
f392a870e9 freshen: resolve root vars
Without doing so we use the same candidate cache entry
for `?0: Trait<?1>` and `?0: Trait<?0>`. These goals are different
and we must not use the same entry for them.
2024-02-22 17:29:26 +01:00
lcnr
91535ad026 remove sub_relations from infcx, recompute in diagnostics
we don't track them when canonicalizing or when freshening,
resulting in instable caching in the old solver, and issues when
instantiating query responses in the new one.
2024-02-22 17:29:25 +01:00
Markus Reiter
b74d8db9d2
Fix example. 2024-02-22 17:16:29 +01:00
许杰友 Jieyou Xu (Joe)
cd25009469
Re-bless tests/pretty 2024-02-22 16:04:05 +00:00
许杰友 Jieyou Xu (Joe)
6e48b96692
[AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
许杰友 Jieyou Xu (Joe)
cbf10affb0
Ignore tidy linelength 2024-02-22 16:04:04 +00:00
许杰友 Jieyou Xu (Joe)
be94059be9
Update tidy target_specific_tests to account for //@ directives 2024-02-22 16:04:03 +00:00
许杰友 Jieyou Xu (Joe)
95f4d4da43
Update tidy target_policy to account for //@ directives 2024-02-22 16:04:03 +00:00
许杰友 Jieyou Xu (Joe)
90a189c19b
Update compiletest to only accept //@ directives 2024-02-22 16:04:03 +00:00
许杰友 Jieyou Xu (Joe)
0840502351
Update list of known directive names for diagnostics 2024-02-22 16:04:03 +00:00
许杰友 Jieyou Xu (Joe)
5fe4e226c9
Fix tests/assembly/stack-protector/stack-protector-target-support.rs
Previously the test seems to not actually test redox.
2024-02-22 16:04:02 +00:00
James Dietz
669f891845 remove exception 2024-02-22 10:04:20 -05:00
bors
933a05bd0b Auto merge of #121372 - clubby789:test-all-tests, r=onur-ozkan
Make `x test tests` work

Fixes #97314

This makes `x test tests` work, and be roughly equivalent to `x test tests/*`. The `--dry-run` output is identical, except for errors on the non-test items in `tests` and a couple of things being in a different order (where path != struct name).

This probably needs a test, but I'm not sure of the best way to do it.
2024-02-22 14:39:16 +00:00
Oli Scherer
e4622e0608 report_mismatch did not actually report anymore 2024-02-22 14:24:25 +00:00
Markus Reiter
0c474acdfa
Use generic NonZero everywhere else. 2024-02-22 15:17:34 +01:00
Markus Reiter
36d194f561
Use generic NonZero everywhere in alloc. 2024-02-22 15:17:34 +01:00
Markus Reiter
e0732e42d8
Use generic NonZero everywhere in std. 2024-02-22 15:17:33 +01:00
Markus Reiter
14ed426eec
Use generic NonZero everywhere in core. 2024-02-22 15:17:33 +01:00
Oli Scherer
e3021eb245 Preserve the Span from prove_predicate all the way to registering opaque types 2024-02-22 14:05:01 +00:00
Jonathan Pallant
a2a6e479a4
Add new maintainers to nto-qnx.md
Ferrous Systems are volunteering myself and Jorge as co-maintainers of the QNX targets.
2024-02-22 13:45:10 +00:00
bors
1bb3a9f67a Auto merge of #121309 - Nilstrieb:inline-all-the-fallbacks, r=oli-obk
Make intrinsic fallback bodies cross-crate inlineable

This change was prompted by the stage1 compiler spending 4% of its time when compiling the polymorphic-recursion MIR opt test in `unlikely`.

Intrinsic fallback bodies like `unlikely` should always be inlined, it's very silly if they are not. To do this, we enable the fallback bodies to be cross-crate inlineable. Not that this matters for our workloads since the compiler never actually _uses_ the "fallback bodies", it just uses whatever was cfg(bootstrap)ped, so I've also added `#[inline]` to those.

See the comments for more information.

r? oli-obk
2024-02-22 12:07:08 +00:00
klensy
53efefb3c2 dedupe env_logger, drop is-terminal 2024-02-22 14:35:21 +03:00
klensy
15bc68118f bump tabled 2024-02-22 14:17:59 +03:00
klensy
0b44330c38 bump sysinfo 2024-02-22 14:01:13 +03:00
bors
52dba5ffe7 Auto merge of #121225 - RalfJung:simd-extract-insert-const-idx, r=oli-obk,Amanieu
require simd_insert, simd_extract indices to be constants

As discussed in https://github.com/rust-lang/rust/issues/77477 (see in particular [here](https://github.com/rust-lang/rust/issues/77477#issuecomment-703149102)). This PR doesn't touch codegen yet -- the first step is to ensure that the indices are always constants; the second step is to then make use of this fact in backends.

Blocked on https://github.com/rust-lang/stdarch/pull/1530 propagating to the rustc repo.
2024-02-22 09:59:41 +00:00
Lukas Wirth
f89d17b426 Remove ops_salsa_runtime_mut, replace it with direct synthetic_write API 2024-02-22 10:42:30 +01:00
Oli Scherer
9e016a8b84 Avoid emitting type mismatches against {type error} 2024-02-22 09:22:50 +00:00
lcnr
7921ce3dd3 DefId to LocalDefId 2024-02-22 10:19:47 +01:00
Johannes Rudolph
c276af2373
Fix typo in metadata.rs doc comment 2024-02-22 09:30:03 +01:00
bors
f70f19fef4 Auto merge of #121129 - nnethercote:codegen-Diags, r=estebank
Improve codegen diagnostic handling

Clarify the workings of the temporary `Diagnostic` type used to send diagnostics from codegen threads to the main thread.

r? `@estebank`
2024-02-22 08:01:37 +00:00
bors
026b3b8e95 Auto merge of #117174 - Ayush1325:uefi-stdio-improve, r=workingjubilee
Improve UEFI stdio

Fixed some things suggested in last PR: #116207

cc `@dvdhrm`
cc `@nicholasbishop`
2024-02-22 06:01:24 +00:00
bors
3815fc0625 Auto merge of #3310 - rust-lang:rustup-2024-02-22, r=oli-obk
Automatic Rustup
2024-02-22 05:06:27 +00:00
The Miri Conjob Bot
6f3bc7d938 fmt 2024-02-22 05:03:17 +00:00
The Miri Conjob Bot
76a596c48d Merge from rustc 2024-02-22 05:02:05 +00:00
The Miri Conjob Bot
f5ec4cb375 Preparing for merge from rustc 2024-02-22 04:54:42 +00:00
bors
c1b478efd3 Auto merge of #121223 - RalfJung:simd-intrinsics, r=Amanieu
intrinsics::simd: add missing functions, avoid UB-triggering fast-math

Turns out stdarch declares a bunch more SIMD intrinsics that are still missing from libcore.
I hope I got the docs and in particular the safety requirements right for these "unordered" and "nanless" intrinsics.

Many of these are unused even in stdarch, but they are implemented in the codegen backend, so we may as well list them here.

r? `@Amanieu`
Cc `@calebzulawski` `@workingjubilee`
2024-02-22 04:02:31 +00:00
James Dietz
03f095f9f2 consolidate tests 2024-02-21 22:41:47 -05:00
Nicholas Nethercote
02423a5747 Make some IntoDiagnostic impls generic.
PR #119097 made the decision to make all `IntoDiagnostic` impls generic,
because this allowed a bunch of nice cleanups. But four hand-written
impls were unintentionally overlooked. This commit makes them generic.
2024-02-22 13:47:30 +11:00
Nicholas Nethercote
326b44e4d3 Fix panic when compiling Rocket.
`Rustc::emit_diagnostic` reconstructs a diagnostic passed in from the
macro machinery. Currently it uses the type `DiagnosticBuilder<'_,
ErrorGuaranteed>`, which is incorrect, because the diagnostic might be a
warning. And if it is a warning, because of the `ErrorGuaranteed` we end
up calling into `emit_producing_error_guaranteed` and the assertion
within that function (correctly) fails because the level is not an error
level.

The fix is simple: change the type to `DiagnosticBuilder<'_, ()>`. Using
`()` works no matter what the diagnostic level is, and we don't need an
`ErrorGuaranteed` here.

The panic was reported in #120576.
2024-02-22 13:46:33 +11:00
bors
c5f69bdd51 Auto merge of #118634 - Jules-Bertholet:box-allocator-static, r=Amanieu
Remove useless `'static` bounds on `Box` allocator

#79327 added `'static` bounds to the allocator parameter for various `Box` + `Pin` APIs to ensure soundness. But it was a bit overzealous, some of the bounds aren't actually needed.
2024-02-22 02:03:29 +00:00
Nicholas Nethercote
6efffd723b Remove SharedEmitterMessage::AbortIfErrors.
It's always paired wth `SharedEmitterMessage::Diagnostic`, so the two
can be merged.
2024-02-22 12:51:11 +11:00
Nicholas Nethercote
ad5d7f43c9 Overhaul rustc_codegen_ssa:🔙:write::Diagnostic.
- Make it more closely match `rustc_errors::Diagnostic`, by making the
  field names match, and adding `children`, which requires adding
  `rustc_codegen_ssa:🔙:write::Subdiagnostic`.
- Check that we aren't missing important info when converting
  diagnostics.
- Add better comments.
- Tweak `rustc_errors::Diagnostic::replace_args` so that we don't need
  to do any cloning when converting diagnostics.
2024-02-22 12:51:11 +11:00
Nicholas Nethercote
b38ed1afa6 Overhaul Diagnostic args.
First, introduce a typedef `DiagnosticArgMap`.

Second, make the `args` field public, and remove the `args` getter and
`replace_args` setter. These were necessary previously because the getter
had a `#[allow(rustc::potential_query_instability)]` attribute, but that
was removed in #120931 when the args were changed from `FxHashMap` to
`FxIndexMap`. (All the other `Diagnostic` fields are public.)
2024-02-22 12:51:05 +11:00
bors
d8b00690ec Auto merge of #121415 - matthiaskrgr:rollup-o9zzet4, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #121206 (Top level error handling)
 - #121261 (coverage: Remove `pending_dups` from the span refiner)
 - #121336 (triagebot: add queue notifications)
 - #121373 (Consistently refer to a test's `revision` instead of `cfg`)
 - #121391 (never patterns: Fix liveness analysis in the presence of never patterns)
 - #121392 (Unify dylib loading between proc macros and codegen backends)
 - #121399 (Solaris linker does not support --strip-debug)
 - #121406 (Add a couple tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-22 00:04:07 +00:00
onur-ozkan
a13ec8d003 add changelog entry
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-22 01:43:13 +03:00
onur-ozkan
94597e85cf force dist.compression-profile = "no-op" for x install
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-22 01:36:56 +03:00
onur-ozkan
3197aee8b3 support no-op compression profile in rust-installer
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-22 01:35:57 +03:00
Matthias Krüger
35650a42a2
Rollup merge of #121406 - compiler-errors:tests, r=Nilstrieb
Add a couple tests

Fixes #119857
Fixes #115497
2024-02-21 22:49:00 +01:00
Matthias Krüger
8ab24c9fc0
Rollup merge of #121399 - psumbera:solaris-strip-debug, r=petrochenkov
Solaris linker does not support --strip-debug

Fixes #121381
2024-02-21 22:49:00 +01:00