1
Fork 0
Commit graph

277127 commits

Author SHA1 Message Date
许杰友 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
Stuart Cook
dec978fb3b Remove the -test suffix from normalize directives (#2172) 2024-12-28 17:32:43 +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
ltdk
f228458e30 Tidy up bigint mul methods 2024-12-27 22:01:51 -05: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
David Tolnay
3fc0f08b89
Rollup merge of #134833 - dtolnay:leftmostwithdot, r=compiler-errors
Skip parenthesis if `.` makes statement boundary unambiguous

There is a rule in the parser that statements and match-arms never end in front of a `.` or `?` token (except when the `.` is really `..` or `..=` or `...`). So some of the leading subexpressions that need parentheses inserted when followed by some other operator like `-` or `+`, do not need parentheses when followed by `.` or `?`.

Example:

```rust
fn main() {
    loop {}.to_string() + "";
    match () {
        _ => loop {}.to_string() + "",
    };
}
```

`-Zunpretty=expanded` before:

```console
#![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std;
fn main() {
    (loop {}).to_string() + "";
    match () { _ => (loop {}).to_string() + "", };
}
```

After:

```console
#![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std;
fn main() {
    loop {}.to_string() + "";
    match () { _ => loop {}.to_string() + "", };
}
```
2024-12-27 18:43:05 -08:00
David Tolnay
2d96f2a48f
Rollup merge of #134827 - compiler-errors:borrowck-nits, r=lqd
Some random region tweaks

Remove a redundant function and add an assertion that I think is useful
2024-12-27 18:43:04 -08:00
David Tolnay
9aebd28ca7
Rollup merge of #134823 - chloefeal:fix, r=tgross35,dtolnay
Fix typos

This PR focuses on correcting typos and improving clarity in documentation files. Thank you.
2024-12-27 18:43:03 -08:00
chloefeal
bc05424528
Update library/alloc/tests/sort/tests.rs
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2024-12-28 10:37:02 +08:00
bors
ecc189922d Auto merge of #134690 - clubby789:ci-clang-lto, r=Kobzol
CI: Add LTO support to clang in dist-x86_64-linux

After https://github.com/rust-lang/cc-rs/pull/1279, we attempt to pass `-flto=thin` to clang. In `dist-x86_64-linux`, we don't build clang with the `LLVMgold.so` library so this fails. This attempts to resolve this
First, pass the binutils plugin include directory to Clang, [which will build the library](2d6d723a85/llvm/docs/GoldPlugin.rst (how-to-build-it))
Second, this library depends on the *version of libstdc++ that we built* specifically. However, despite both the RPATH and LD_LIBRARY_PATH pointing to `/rustroot/lib`, we incorrectly resolve to the system libstdc++, which doesn't load.
```
# LD_DEBUG=libs,files
      2219:    file=libstdc++.so.6 [0];  needed by /rustroot/bin/../lib/LLVMgold.so [0]
      2219:    find library=libstdc++.so.6 [0]; searching
      2219:     search path=/rustroot/bin/../lib/../lib        (RPATH from file /rustroot/bin/../lib/LLVMgold.so)
      2219:      trying file=/rustroot/bin/../lib/../lib/libstdc++.so.6
      2219:     search path=/usr/lib64/tls:/usr/lib64        (system search path)
      2219:      trying file=/usr/lib64/tls/libstdc++.so.6
      2219:      trying file=/usr/lib64/libstdc++.so.6
```

Using `LD_PRELOAD` causes it to correctly load the library

I think this is probably not the most maintainable way to do this, so opening to see if this is desired and if there's a better way of doing this
2024-12-27 23:22:08 +00:00
David Tolnay
26bb4e6464
Skip parenthesis around tuple struct field calls 2024-12-27 14:33:56 -08:00
Trevor Gross
68bd853bb6 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-27 22:26:08 +00:00
David Tolnay
c95f9f50de
Add pretty-printer test of tuple field function call 2024-12-27 14:18:39 -08:00
David Tolnay
e67fe3698b
Skip parenthesis if . makes statement boundary unambiguous 2024-12-27 13:53:02 -08:00
David Tolnay
fef8ec5ad9
Add test of dot after eager statement boundary expr 2024-12-27 13:41:46 -08:00
bors
dd84b7d5ee Auto merge of #134830 - matthiaskrgr:rollup-7hdjojz, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #133663 (Add a compiler intrinsic to back `bigint_helper_methods`)
 - #134798 (Make `ty::Error` implement all auto traits)
 - #134808 (compiletest: Remove empty 'expected' files when blessing)
 - #134809 (Add `--no-capture`/`--nocapture` as bootstrap arguments)
 - #134826 (Add spastorino to users_on_vacation)
 - #134828 (Add clubby789 back to bootstrap review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-27 19:30:32 +00:00
Matthias Krüger
6385e65d16
Rollup merge of #134828 - clubby789:ununreview, r=lqd
Add clubby789 back to bootstrap review rotation
2024-12-27 19:47:12 +01:00
Matthias Krüger
a77a827333
Rollup merge of #134826 - spastorino:vacations, r=lqd
Add spastorino to users_on_vacation
2024-12-27 19:47:12 +01:00
Matthias Krüger
5b249f813b
Rollup merge of #134809 - clubby789:nocapture, r=jieyouxu
Add `--no-capture`/`--nocapture` as bootstrap arguments

I often try `x test ... --nocapture` => 'unknown argument' => `x test ... -- --nocapture`. As we forward several other compiletest flags, let's recognise this one in bootstrap as well.
2024-12-27 19:47:11 +01:00
Matthias Krüger
7ba9655cce
Rollup merge of #134808 - clubby789:compiletest-remove-stderr, r=jieyouxu
compiletest: Remove empty 'expected' files when blessing

Fixes #134793
Fixes #134196

This also refactors `compare_output` to return an enum; returning a usize was done for convenience but is misleading
2024-12-27 19:47:11 +01:00
Matthias Krüger
26fb78a891
Rollup merge of #134798 - compiler-errors:err-auto, r=jackh726
Make `ty::Error` implement all auto traits

I have no idea what's up with the crashes test I fixed--I really don't want to look into it since it has to do something with borrowck and multiple layers of opaques. I think the underlying idea of allowing error types to implement all auto traits is justified though.

Fixes #134796
Fixes #131050

r? lcnr
2024-12-27 19:47:10 +01:00
Matthias Krüger
95e66ff8b4
Rollup merge of #133663 - scottmcm:carrying_mul_add, r=Amanieu
Add a compiler intrinsic to back `bigint_helper_methods`

cc https://github.com/rust-lang/rust/issues/85532

This adds a new `carrying_mul_add` intrinsic, to implement `wide_mul` and `carrying_mul`.

It has fallback MIR for all types -- including `u128`, which isn't currently supported on nightly -- so that it'll continue to work on all backends, including CTFE.

Then it's overridden in `cg_llvm` to use wider intermediate types, including `i256` for `u128::carrying_mul`.
2024-12-27 19:47:09 +01:00
clubby789
df189f6b36 Add clubby789 to bootstrap review rotation 2024-12-27 18:23:49 +00:00
Michael Goulet
85aad52ce8 Make sure there are no registered constraints from creating universal region vids 2024-12-27 17:58:16 +00:00
Santiago Pastorino
6039eab641
Add spastorino to users_on_vacation 2024-12-27 14:43:24 -03:00
bors
e5f0d6ffbd Auto merge of #134803 - clubby789:strip-debuginfo, r=Kobzol
Strip debuginfo from rustc-main and rustdoc

r? `@Kobzol`
Split from #134690
2024-12-27 16:50:53 +00:00
Scott McMurray
4669c0d756 Override carrying_mul_add in cg_llvm 2024-12-27 08:17:40 -08:00
Scott McMurray
2c0c9123fc Move {widening, carrying}_mul to an intrinsic with fallback MIR
Including implementing it for `u128`, so it can be defined in `uint_impl!`.

This way it works for all backends, including CTFE.
2024-12-27 08:17:40 -08:00
chloefeal
e1b65be417
Fix typos
Signed-off-by: chloefeal <188809157+chloefeal@users.noreply.github.com>
2024-12-27 21:35:57 +08:00
bors
6d3db555e6 Auto merge of #134822 - jieyouxu:rollup-5xuaq82, r=jieyouxu
Rollup of 8 pull requests

Successful merges:

 - #134606 (ptr::copy: fix docs for the overlapping case)
 - #134622 (Windows: Use WriteFile to write to a UTF-8 console)
 - #134759 (compiletest: Remove the `-test` suffix from normalize directives)
 - #134787 (Spruce up the docs of several queries related to the type/trait system and const eval)
 - #134806 (rustdoc: use shorter paths as preferred canonical paths)
 - #134815 (Sort triples by name in platform_support.md)
 - #134816 (tools: fix build failure caused by PR #134420)
 - #134819 (Fix mistake in windows file open)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-27 13:01:07 +00:00
许杰友 Jieyou Xu (Joe)
5544091054
Rollup merge of #134819 - ChrisDenton:trunc, r=Mark-Simulacrum
Fix mistake in windows file open

In #134722 this should have been `c::FileAllocationInfo` not `c::FileEndOfFileInfo`. Oops.
2024-12-27 20:44:15 +08:00
许杰友 Jieyou Xu (Joe)
f65dc4f375
Rollup merge of #134816 - Integral-Tech:pathbuf-refactor, r=lqd
tools: fix build failure caused by PR #134420

Someone reports build failure after merging pull request #134420: https://github.com/rust-lang/rust/pull/134420#discussion_r1898081258

This pull request fixes the build failure.
2024-12-27 20:44:15 +08:00
许杰友 Jieyou Xu (Joe)
3980cc6521
Rollup merge of #134815 - 9names:sort_platform_md_targets, r=jieyouxu
Sort triples by name in platform_support.md

When looking for riscv32emc support, I missed it at first because it was at the end of the tier3 target list [here](https://doc.rust-lang.org/rustc/platform-support.html#tier-3). These lists are *mostly* dictionary sorted so I assumed it should be near the riscv32i* targets.

This PR puts all targets back in dictionary order. There were only a few outside of tier3.

I ended up writing a small program to sort them because I did not trust myself to do it manually, but I stopped short of fully automating it.
I have manually reviewed the output to confirm it still has the same number of entries, and that the changed values do follow the ordering I would expect.

For folks who would prefer to review code than manual textual changes, the sorting program (including inputs) is [here.](https://github.com/9names/platform_sort_arch/blob/main/src/main.rs)
2024-12-27 20:44:14 +08:00
许杰友 Jieyou Xu (Joe)
d419cc7c6a
Rollup merge of #134806 - notriddle:notriddle/parent-path-is-better, r=GuillaumeGomez
rustdoc: use shorter paths as preferred canonical paths

This is a solution to [the `std::sync::poison` linking problem](https://github.com/rust-lang/rust/pull/134692#issuecomment-2560373308), and, in general, makes intra-doc links shorter and clearer.

> Done. This helped with the search, but not with the things like `MutexGuard`'s doc's reference to `Mutex::lock` being converted to the absolute (unstable) `std::sync::poison::Mutex` path.

cc `@tgross35`

r? `@GuillaumeGomez`
2024-12-27 20:44:13 +08:00