Commit Graph

274279 Commits

Author SHA1 Message Date
Jakub Beránek
9007cb15e4 Document how to run the split Docker pipelines 2024-12-29 18:02:14 +01:00
bors
64feb9b502 Auto merge of #134887 - Zalathar:rollup-ghpz7oy, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - #134799 (nits: Cleanups in `librustdoc::clean`)
 - #134851 (docs: inline `alloc::ffi::c_str` types to `alloc::ffi`)
 - #134869 (Bump compiler cc)
 - #134876 (bootstrap: Consolidate the macros for declaring compiletest test suites)
 - #134883 (bootstrap: Fix `./x check bootstrap` by moving `shared_helpers::tests`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-29 12:43:22 +00:00
Stuart Cook
fc89cb202f
Rollup merge of #134883 - Zalathar:shared-helpers, r=clubby789
bootstrap: Fix `./x check bootstrap` by moving `shared_helpers::tests`

Running `./x check bootstrap` currently doesn't work, because it builds the bootstrap shim binaries with `cfg(test)`, and those binaries can't find a `tests` submodule when they include `shared_helpers.rs` via `#[path]`.

This PR fixes that by taking the tests module and moving it to `super::tests::shared_helpers_tests` instead.

(The extra `tests` submodule prevents tidy from complaining about unit tests that aren't in a dedicated tests module.)

---

It would be nice to also run `./x check bootstrap compiletest` in CI, so that this and #134848 don't regress, but I didn't want to bundle that change with this fix.
2024-12-29 22:45:39 +11:00
Stuart Cook
a43730b2af
Rollup merge of #134876 - Zalathar:bootstrap-test-macros, r=jieyouxu
bootstrap: Consolidate the macros for declaring compiletest test suites

Instead of using a dizzying assortment of different macros to declare these test suite steps, we can mostly just use one `test!` macro with a few optional named arguments.

I'm pretty sure that this doesn't change any behaviour, but please do double-check each of the individual declarations.
2024-12-29 22:45:38 +11:00
Stuart Cook
ea2851b24b
Rollup merge of #134869 - clubby789:cc-bump, r=jieyouxu
Bump compiler cc

Fixes #134657
Pulls in https://github.com/rust-lang/cc-rs/pull/1330

try-job: x86_64-msvc
2024-12-29 22:45:38 +11:00
Stuart Cook
8f4bf86740
Rollup merge of #134851 - lukas-code:alloc-ffi, r=tgross35
docs: inline `alloc::ffi::c_str` types to `alloc::ffi`

like https://github.com/rust-lang/rust/pull/134791 but for `alloc`

r? ``@tgross35`` ``@notriddle``
2024-12-29 22:45:37 +11:00
Stuart Cook
42a372fd7f
Rollup merge of #134799 - poliorcetics:ab/push-xuxotrnrtysz, r=GuillaumeGomez
nits: Cleanups in `librustdoc::clean`

r? ````@GuillaumeGomez````
2024-12-29 22:45:36 +11:00
bors
e7738afb70 Auto merge of #134650 - onur-ozkan:clean-up-fixmes, r=Kobzol
Clean up some FIXME notes on bootstrap

Fixing and removing some FIXME notes.
2024-12-29 10:04:55 +00:00
Zalathar
4192293b4d Fix ./x check bootstrap by moving shared_helpers::tests 2024-12-29 20:49:03 +11:00
bors
fd19773d2f Auto merge of #134627 - estebank:issue-133252, r=jackh726
Avoid ICE in borrowck

Provide a fallback in `best_blame_constraint` when `find_constraint_paths_between_regions` doesn't have a result. This code is due a rework to avoid the letf-over `unwrap()`, but avoids the ICE caused by the repro.

Fix #133252.
2024-12-29 07:23:59 +00:00
Zalathar
1e37bbe2de Allow macro-declared test steps to have docstrings and attributes 2024-12-29 15:50:47 +11:00
Zalathar
7b7f634cac Consolidate the macros for declaring compiletest suites 2024-12-29 15:50:47 +11:00
bors
480eec0692 Auto merge of #134867 - rust-lang:cargo_update, r=clubby789
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 8 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating glob v0.3.1 -> v0.3.2
    Updating quote v1.0.37 -> v1.0.38
    Updating rustversion v1.0.18 -> v1.0.19
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 5 unchanged dependencies behind latest

rustbook dependencies:
     Locking 7 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating cc v1.2.5 -> v1.2.6
    Updating quote v1.0.37 -> v1.0.38
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
```
2024-12-29 03:16:29 +00:00
bors
0b63477350 Auto merge of #134864 - Zalathar:rollup-suc8ay9, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - #134849 (compiletest: Slightly simplify the handling of debugger directive prefixes)
 - #134850 (Document virality of `feature(rustc_private)`)
 - #134852 (Added a codegen test for optimization with const arrays)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-29 00:38:26 +00:00
clubby789
8c8fed7ea9 Bump compiler cc 2024-12-29 00:30:32 +00:00
github-actions
519c233cbb cargo update
compiler & tools dependencies:
     Locking 8 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating glob v0.3.1 -> v0.3.2
    Updating quote v1.0.37 -> v1.0.38
    Updating rustversion v1.0.18 -> v1.0.19
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 5 unchanged dependencies behind latest

rustbook dependencies:
     Locking 7 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating cc v1.2.5 -> v1.2.6
    Updating quote v1.0.37 -> v1.0.38
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
2024-12-29 00:22:58 +00:00
Stuart Cook
0a52407d43
Rollup merge of #134852 - alex:patch-1, r=durin42
Added a codegen test for optimization with const arrays

Closes #107208
2024-12-29 10:00:19 +11:00
Stuart Cook
8060f58150
Rollup merge of #134850 - tamird:rustc-private-book-update, r=bjorn3
Document virality of `feature(rustc_private)`

Closes #134825.

r? `@bjorn3`
2024-12-29 10:00:18 +11:00
Stuart Cook
a8a10110e0
Rollup merge of #134849 - Zalathar:debuginfo-prefixes, r=lqd,clubby789,jieyouxu
compiletest: Slightly simplify the handling of debugger directive prefixes

The `cdbg-` prefix is not used by any tests in `tests/debuginfo`, and perhaps there never were any tests that used it.

Getting rid of it also lets us get rid of the code for parsing multiple prefixes at the same time, since every debugger now has exactly one prefix.
2024-12-29 10:00:18 +11:00
Alexis (Poliorcetics) Bourget
f5c497529c
nits: librustdoc::clean
- librustdoc::clean::clean_lifetime doesn't need a mut doc context
- librustdoc::clean::normalize doesn't need a mut doc context
- move Some() wrapping up into `clean_predicate()`
- simplify nested if in librustdoc::clean::record_extern_fqn()
2024-12-28 23:53:18 +01:00
bors
b76036c88c Auto merge of #134848 - Zalathar:check-compiletest, r=jieyouxu
bootstrap: Allow `./x check compiletest`

Did you know that bootstrap didn't support `./x check compiletest`? Well, now it does!

Manually add `"compiletest"` to your `rust-analyzer.check.overrideCommand` check command to get error/warning integration when modifying compiletest.
2024-12-28 22:00:11 +00:00
Alex Gaynor
d6c73ebbf3 Added a codegen test for optimization with const arrays
Closes #107208
2024-12-28 13:28:35 -06:00
bors
8742e0556d Auto merge of #134845 - jieyouxu:temp-drop-warning, r=onur-ozkan
bootstrap: drop warning for top-level test suite path check due to false positives

The current top-level test suite directory does not exist warning logic doesn't quite handle the more exotic path suffix matches that test filters seem to accept (e.g. `library/test` can be matched with `--exclude test`), so avoid warning on non-existent top-level test suites for now. To avoid false positives, we probably need to query test `Step`s for their `should_run(exclude_filter)` logic.

This retains the fix for the Windows path handling (unlike #134843).

r? `@onur-ozkan`
2024-12-28 19:20:22 +00:00
Tamir Duberstein
35e5c7d438
Document virality of feature(rustc_private)
Since 9cb1998ea1 this feature is viral.
2024-12-28 11:45:25 -05:00
bors
ceb0441e82 Auto merge of #134790 - onur-ozkan:cfg-test, r=clubby789
replace bootstrap-self-test feature flag with cfg(test)

This makes it in more rusty way.
2024-12-28 16:37:13 +00:00
Lukas Markeffsky
11ad6ff3cb docs: inline alloc::ffi::c_str types to alloc::ffi 2024-12-28 15:42:39 +01:00
bors
3c1e750364 Auto merge of #134547 - SUPERCILEX:unify-copy, r=thomcc
Unify fs::copy and io::copy on Linux

Currently, `fs::copy` first tries a regular file copy (via copy_file_range) and then falls back to userspace read/write copying. We should use `io::copy` instead as it tries copy_file_range, sendfile, and splice before falling back to userspace copying. This was discovered here: https://github.com/SUPERCILEX/fuc/issues/40

Perf impact: `fs::copy` will now have two additional statx calls to decide which syscall to use. I wonder if we should get rid of the statx calls and only continue down the next fallback when the relevant syscalls say the FD isn't supported.
2024-12-28 13:49:45 +00:00
Zalathar
2f8824a477 Simplify DebuggerCommands::parse_from to only take one prefix 2024-12-29 00:09:25 +11:00
Zalathar
a625ddd1ed Remove the unused cdbg-* debugger directive prefix
There are no tests in `tests/debuginfo` that use this prefix.
2024-12-29 00:09:25 +11:00
Zalathar
c1c2d85cc9 bootstrap: Allow ./x check compiletest 2024-12-28 23:23:41 +11:00
bors
4e0bc490c6 Auto merge of #131244 - clubby789:match-branches-unreachable, r=DianQK
Consider empty-unreachable otherwise branches in MatchBranchSimplification

Fixes #131219
2024-12-28 11:09:28 +00:00
许杰友 Jieyou Xu (Joe)
c393811a48 bootstrap: drop warning for top-level test suite path check
This doesn't quite handle the more exotic path suffix matches that test
filters seem to accept (e.g. `library/test` can be matched with
`--exclude test`), so avoid warning on non-existent top-level test
suites for now. A proper fix will need to possibly query test `Step`s
for their exclude logic.
2024-12-28 17:55:05 +08:00
onur-ozkan
eedafbc92f remove deprecated option parallel-compiler
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-28 11:35:29 +03:00
onur-ozkan
47cd3e7c61 read to String directly without extra conversion
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-28 11:34:00 +03:00
onur-ozkan
ec9502d803 remove an invalid FIXME note
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-28 11:33:57 +03:00
bors
8b3f7ac526 Auto merge of #134844 - Zalathar:rollup-1225wh9, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - #134737 (Implement `default_overrides_default_fields` lint)
 - #134760 (Migrate `branch-protection-check-IBT` to rmake.rs)
 - #134829 (Migrate `libs-through-symlink` to rmake.rs)
 - #134832 (Update `compiler-builtins` to 0.1.140)
 - #134840 (compiletest: Only pass the post-colon value to `parse_normalize_rule`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-28 08:26:48 +00:00
Stuart Cook
41c74f4fb6
Rollup merge of #134840 - Zalathar:normalize, r=jieyouxu
compiletest: Only pass the post-colon value to `parse_normalize_rule`

Addresses one of the FIXMEs noted in #134759.

I started working on the other FIXME, but it became complex enough that I wanted to split it off from this PR.

r? jieyouxu
2024-12-28 16:50:39 +11:00
Stuart Cook
d21cdf78f9
Rollup merge of #134832 - tgross35:update-builtins, r=tgross35
Update `compiler-builtins` to 0.1.140

Nothing significant here, just syncing the following small changes:

- https://github.com/rust-lang/compiler-builtins/pull/727
- https://github.com/rust-lang/compiler-builtins/pull/730
- https://github.com/rust-lang/compiler-builtins/pull/736
- https://github.com/rust-lang/compiler-builtins/pull/737
2024-12-28 16:50:38 +11:00
Stuart Cook
3048c4adfc
Rollup merge of #134829 - jieyouxu:migrate-libs-through-symlinks, r=lqd
Migrate `libs-through-symlink` to rmake.rs

Part of https://github.com/rust-lang/rust/issues/121876.

This PR migrates `tests/run-make/libs-through-symlink/` to use rmake.rs.

- Regression test for #13890.
- Original fix PR is #13903.
- Document test intent, backlink to #13890 and fix PR #13903.
- Fix the test logic: the `Makefile` version seems to not actually be exercising the "library search traverses symlink" logic, because the actual symlinked-to-library is present under the `$(TMPDIR)` directory tree when `bar.rs` is compiled, because the `$(RUSTC)` invocation has an implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e. it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it used `ln -nsf outdir/$(NAME) $(TMPDIR)`. The rmake.rs version now explicitly separates the two directory trees and sets the CWD of the `bar.rs` rustc invocation so that the actual library is *not* present under its CWD tree.

I.e. it is now

```
$test_output/           # rustc foo.rs -o actual_lib_dir/libfoo.rlib
    actual_lib_dir/
        libfoo.rlib
    symlink_lib_dir/    # CWD set; rustc -L . bar.rs
        libfoo.rlib --> $test_output/actual_lib_dir/libfoo.rlib
```

Partially supersedes #129011.
This PR is co-authored with `@Oneirical.`

r? compiler
2024-12-28 16:50:38 +11:00
Stuart Cook
dd03fba6dd
Rollup merge of #134760 - jieyouxu:enable-branch-protection-check-IBT, r=lqd
Migrate `branch-protection-check-IBT` to rmake.rs

- The Makefile version *never* ran because of Makefile syntax confusion because `ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86_64)` [compares `x86` to `x86_64`, which always evaluates to false](https://github.com/rust-lang/rust/pull/126720#discussion_r1646808973).
- The test would've always failed because precompiled std is not built with `-Z cf-protection=branch`, but linkers require all input object files to indicate IBT support in order to enable IBT for the executable, which is not the case for std.
- Thus, the test input file is instead changed to a `no_std` program.
- The test is currently limited to only `x86_64-unknown-linux-gnu` host, there are various other problems when the test is cross-compiled that I didn't want to fix atm, and is left as an exercise for the `-Z cf-protection` implementers.

The GNU property note was added by #110304 in order to address #103001.

Partially supersedes #129156.
The rmake.rs port was initially authored by `@Rejyr` in #126720.
This PR is co-authored with `@Oneirical` and `@Rejyr.`

r? `@bjorn3` or reroll

try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
try-job: x86_64-msvc
try-job: x86_64-apple-1
try-job: x86_64-apple-2
2024-12-28 16:50:37 +11:00
Stuart Cook
3e3db73c9b
Rollup merge of #134737 - estebank:deive-lint-default-fields-base, r=compiler-errors
Implement `default_overrides_default_fields` lint

Detect when a manual `Default` implementation isn't using the existing default field values and suggest using `..` instead:

```
error: `Default` impl doesn't use the declared default field values
  --> $DIR/manual-default-impl-could-be-derived.rs:14:1
   |
LL | / impl Default for A {
LL | |     fn default() -> Self {
LL | |         A {
LL | |             y: 0,
   | |                - this field has a default value
...  |
LL | | }
   | |_^
   |
   = help: use the default values in the `impl` with `Struct { mandatory_field, .. }` to avoid them diverging over time
note: the lint level is defined here
  --> $DIR/manual-default-impl-could-be-derived.rs:5:9
   |
LL | #![deny(default_overrides_default_fields)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

r? `@compiler-errors`

This is a simpler version of #134441, detecting the simpler case when a field with a default should have not been specified in the manual `Default::default()`, instead using `..` for it. It doesn't provide any suggestions, nor the checks for "equivalences" nor whether the value used in the imp being used would be suitable as a default field value.
2024-12-28 16:50:36 +11:00
bors
7cb084932e Auto merge of #134842 - jieyouxu:disable-flaky-test, r=ibraheemdev
Disable `backtrace-debuginfo.rs` on windows-gnu

This test appears still flaky cf. #117097 on `i686-mingw` as observed in https://github.com/rust-lang/rust/pull/131244#issuecomment-2564086577.

r? compiler (or anyone, really)
2024-12-28 05:48:39 +00:00
许杰友 Jieyou Xu (Joe)
b32591e580 tests: migrate branch-protection-check-IBT to rmake.rs
- The Makefile version *never* ran because of Makefile syntax confusion.
- The test would've always failed because precompiled std is not built
  with `-Z cf-protection=branch`, but linkers require all input object
  files to indicate IBT support in order to enable IBT for the
  executable, which is not the case for std.
- Thus, the test input file is instead changed to a `no_std` + `no_core`
  program.

Co-authored-by: Jerry Wang <jerrylwang123@gmail.com>
Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-28 11:58:32 +08:00
许杰友 Jieyou Xu (Joe)
b77ab2dd90 tests: migrate libs-through-symlink to rmake.rs
- Document test intent, backlink to #13890 and fix PR #13903.
- Fix the test logic: the `Makefile` version seems to not actually be
  exercising the "library search traverses symlink" logic, because the
  actual symlinked-to-library is present under the directory tree when
  `bar.rs` is compiled, because the `$(RUSTC)` invocation has an
  implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e.
  it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it
  used `ln -nsf outdir/$(NAME) $(TMPDIR)`.

Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-28 11:53:01 +08:00
Zalathar
f55736365a compiletest: Make a FIXME for escaped newlines less confusing
The old FIXME implies that we don't support escaped newlines, but in fact it
was added in the same patch that added support for escaped newlines.

The new FIXME makes it clear that we do currently support this, and that the
FIXME is for doing so in a less ad-hoc way.
2024-12-28 14:23:46 +11:00
许杰友 Jieyou Xu (Joe)
378dc0357d Disable backtrace-debuginfo.rs on windows-gnu 2024-12-28 11:19:16 +08:00
bors
2b0ceb8c8c Auto merge of #134839 - dtolnay:rollup-1jm11rl, r=dtolnay
Rollup of 4 pull requests

Successful merges:

 - #134823 (Fix typos)
 - #134827 (Some random region tweaks)
 - #134833 (Skip parenthesis if `.` makes statement boundary unambiguous)
 - #134834 (Skip parenthesis around tuple struct field calls)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-28 03:06:22 +00:00
Zalathar
3a4e82195e compiletest: Only pass the post-colon value to parse_normalize_rule 2024-12-28 13:57:13 +11:00
Zalathar
ef19017f7c compiletest: Self-test for normalize-* with revisions 2024-12-28 13:57:13 +11:00
David Tolnay
0a09252866
Rollup merge of #134834 - dtolnay:unnamedcall, r=compiler-errors
Skip parenthesis around tuple struct field calls

The pretty-printer previously did not distinguish between named vs unnamed fields when printing a function call containing a struct field. It would print the call as `(self.fun)()` for a named field which is correct, and `(self.0)()` for an unnamed field which is redundant.

This PR changes function calls of tuple struct fields to print without parens.

**Before:**

```rust
struct Tuple(fn());

fn main() {
    let tuple = Tuple(|| {});
    (tuple.0)();
}
```

**After:**

```rust
struct Tuple(fn());

fn main() {
    let tuple = Tuple(|| {});
    tuple.0();
}
```
2024-12-27 18:43:05 -08:00