Commit Graph

301225 Commits

Author SHA1 Message Date
León Orell Valerian Liehr
9bb9c39fa5 Don't suggest assoc ty bound on non-angle-bracketed problematic assoc ty binding 2025-07-23 01:59:25 +02:00
binarycat
95de0aaed3 rustc_resolve: get rid of unused rustdoc::span_of_fragments_with_expansion
This function can cause false negatives if used incorrectly
(usually "do any of the doc fragments come from a macro" is
the wrong question to ask), and thus it is unused.
2025-07-22 18:36:09 -05:00
Camille GILLOT
3440bc92f9 Unquerify extern_mod_stmt_cnum. 2025-07-22 22:37:50 +00:00
binarycat
9e75032a9d rustdoc: avoid allocating a temp String for aliases in search index 2025-07-22 14:51:38 -05:00
bors
a7a1618e6c Auto merge of #144249 - GuillaumeGomez:asm-tests, r=jieyouxu
Rename `tests/{assembly,codegen}` into `tests/{assembly,codegen}-llvm` and ignore these testsuites if configured backend doesn't match

Follow-up of https://github.com/rust-lang/rust/pull/144125.

This PR changes `compiletest` so that `asm` tests are only run if they match the current codegen backend. To better reflect it, I renamed the `tests/ui/asm` folder into `tests/ui/asm-llvm`. Like that, we can add new asm tests for other backends if we want without needing to add extra code to `compiletest`.

Next step will be to use the new code annotations added in rust-lang/rust#144125 to ignore ui tests failing in cg_gcc until it's fixed on our side.

cc `@antoyo` `@oli-obk`
r? `@Kobzol`
2025-07-22 18:39:58 +00:00
Jakub Beránek
9a1179c4de Embed auxv files directly into the test binary 2025-07-22 20:22:16 +02:00
Jakub Beránek
81d90d8257 Improve error messages of auxv loading 2025-07-22 20:22:16 +02:00
Jakub Beránek
5e52677a82 Remove licenses from std-detect
They are subsumed by the main repo licenses.
2025-07-22 20:22:16 +02:00
Jakub Beránek
cbd9fe012a Bless bootstrap tests 2025-07-22 20:22:16 +02:00
Jakub Beránek
847f8db5ad Remove std_detect from stdarch's CI 2025-07-22 20:22:16 +02:00
Jakub Beránek
608297247a Remove std_detect from stdarch examples 2025-07-22 20:22:16 +02:00
Jakub Beránek
ffa97a647e Fix warning 2025-07-22 20:22:16 +02:00
Jakub Beránek
e07a1bbb79 Move tests around to appease tidy 2025-07-22 20:22:16 +02:00
Jakub Beránek
8dc2abb5c3 Update stdarch README 2025-07-22 20:17:49 +02:00
Jakub Beránek
ee6f2c5276 Reformat std_detect 2025-07-22 20:17:46 +02:00
Jakub Beránek
1057a2213a Allow platform-specific code in std_detect 2025-07-22 20:17:24 +02:00
Jakub Beránek
b23ab7888a Make std_detect a direct dependency of std 2025-07-22 20:17:23 +02:00
Jakub Beránek
5b2de8ab27 Move std_detect from library/stdarch to library 2025-07-22 20:17:06 +02:00
binarycat
2d1fccd7a1 pass build.npm from bootstrap to tidy and use it for npm install 2025-07-22 12:46:19 -05:00
binarycat
25bbaf0d5c bootstrap: add package.json and package-lock.json to dist tarball
this ensures that js-related tests can still be run from within
such a dist tarball.
2025-07-22 11:58:34 -05:00
Jens Reidel
f5a33e8897 Add powerpc64le-unknown-linux-musl to CI rustc targets
I missed this in the promotion to tier 2 with host tools.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-22 17:31:55 +02:00
yanglsh
6a8780473e fix: unused_async FP on function with todo! 2025-07-22 23:25:31 +08:00
bors
2e53675668 Auto merge of #144222 - Kobzol:stdarch-push, r=folkertdev
stdarch subtree update

Subtree update of `stdarch` to 5531955678.

Created using https://github.com/rust-lang/josh-sync.

I saw that there were non-trivial changes made to `std_detect` in `stdarch` recently. So I want to get them merged here before we move forward with https://github.com/rust-lang/rust/pull/143412.

r? `@folkertdev`
2025-07-22 15:25:31 +00:00
Guillaume Gomez
6bfa00816d Only run tests/assembly-* and tests/codegen-* tests if they match the current codegen backend 2025-07-22 16:43:03 +02:00
yuk1ty
0aa617001a Add a test case for ui test false-sealed-traits-note.rs 2025-07-22 23:31:10 +09:00
Guillaume Gomez
a27f3e3fd1 Rename tests/codegen into tests/codegen-llvm 2025-07-22 14:28:48 +02:00
Guillaume Gomez
ed93c1783b Rename tests/assembly into tests/assembly-llvm 2025-07-22 14:27:48 +02:00
bors
35487a2e7c Auto merge of #144294 - matthiaskrgr:rollup-ybvall3, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#142454 (Add modern AVR mcus like avr128db28 and attiny3224)
 - rust-lang/rust#142924 (tidy: move rustdoc js stuff into a tidy extra check)
 - rust-lang/rust#143373 (Unquerify maybe_unused_trait_imports.)
 - rust-lang/rust#144082 (tests: cover more `exported_private_dependencies` cases)
 - rust-lang/rust#144126 (Fix empty target_config in apply_rust_config bootstrap)
 - rust-lang/rust#144164 ( opt-dist: add an option for setting path to stage0 root)
 - rust-lang/rust#144265 (Dont ICE on copy error being suppressed due to overflow)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-22 11:32:36 +00:00
xizheyin
2832517ba1 Clean code for rustc_parse/src/lexer
1. Rename `make_unclosed_delims_error` and return `Vec<Diag>`
2. change magic number `unclosed_delimiter_show_limit` to const
3. move `eof_err` below parsing logic
4. Add `calculate_spacing` for `bump` and `bump_minimal`

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-22 18:38:33 +08:00
Zalathar
f877aa7d14 coverage: Enlarge empty spans during MIR instrumentation, not codegen
This allows us to assume that coverage spans will only be discarded during
codegen in very unusual situations.
2025-07-22 19:49:54 +10:00
bors
c0b282f0cc Auto merge of #144205 - hkBst:flt2dec, r=workingjubilee
flt2dec: replace for loop by iter_mut

Perf is explored in https://github.com/rust-lang/rust/issues/144118, which initially showed small losses, but then also showed significant gains. Both are real, but given the smallness of the losses, this seems a good change.
2025-07-22 08:28:29 +00:00
Matthias Krüger
749f895d95 Rollup merge of #144265 - compiler-errors:copy-ice, r=oli-obk
Dont ICE on copy error being suppressed due to overflow

See comment in test file.

Fixes https://github.com/rust-lang/rust/issues/144165
2025-07-22 10:26:16 +02:00
Matthias Krüger
5c9a37faf7 Rollup merge of #144164 - ognevny:opt-dist-stage0-root, r=Kobzol
opt-dist: add an option for setting path to stage0 root

in MSYS2 we have problems with stage0 for *-gnullvm hosts because prebuilt dist tarballs will be
available starting from 1.90.0-beta. also this change helps to match bootstrap.toml config

r? Kobzol

try-job: dist-x86_64-msvc
try-job: dist-x86_64-linux
2025-07-22 10:26:16 +02:00
Matthias Krüger
cb3395b24f Rollup merge of #144126 - Shourya742:2025-06-18-fix-target-config-issue, r=Kobzol
Fix empty target_config in apply_rust_config bootstrap

This PR fixes the issue of an empty target_config in apply_rust_config, which was caused by the ordering of TOML config parsing. This was inadvertently introduced during the last config refactor. The test and the corresponding configuration order have been corrected in this PR.

r? ```@Kobzol```
2025-07-22 10:26:15 +02:00
Matthias Krüger
3ed170f02c Rollup merge of #143373 - cjgillot:bare-unused-trait-imports, r=petrochenkov
Unquerify maybe_unused_trait_imports.

Based on https://github.com/rust-lang/rust/pull/143247
r? ```@ghost``` for perf
2025-07-22 10:26:14 +02:00
Matthias Krüger
cdc79bdbd9 Rollup merge of #144082 - mladedav:dm/pub-priv-tests, r=petrochenkov
tests: cover more `exported_private_dependencies` cases

This PR adds tests for all missing cases from rust-lang/rust#71043 and some on top of that. I believe with this, that issue can be closed.

Some of the lints can be improved, e.g. `provided_impl_trait` and `impl From<PublicWithStdImpl> for OtherType` lint twice.

cc ```@epage``` in case you want to double check I didn't miss anything.
2025-07-22 10:26:14 +02:00
Matthias Krüger
b934f1adca Rollup merge of #143373 - cjgillot:bare-unused-trait-imports, r=petrochenkov
Unquerify maybe_unused_trait_imports.

Based on https://github.com/rust-lang/rust/pull/143247
r? ```@ghost``` for perf
2025-07-22 10:26:14 +02:00
Matthias Krüger
73305e2240 Rollup merge of #142924 - lolbinarycat:tidy-js-extra-checks, r=Kobzol
tidy: move rustdoc js stuff into a tidy extra check

Most of these were factored out of CI scripts, but `eslint` in particular was previously implemented with its own special cased logic.

A new option has been added to bootstrap, `build.tidy-extra-checks`, which serves as a default value for the `--extra-checks` flag.  This is mostly for the benefit of rustdoc js maintainers, but should also help bootstrap py maintainers.

Additionally, `--extra-checks=cpp` has been documented.

I'm not super happy with how long the extra check names are in comparison to the others (in particular `typecheck`), but I couldn't think of anything better (I didn't want to name it `tsc` on the off chance we want to switch to a different typechecking engine in the future).

It would be nice to convert the extra checks arg into a proper enum, both for warning on unknown values and to provide better shell completion.

r? ```@GuillaumeGomez```

Fixes: https://github.com/rust-lang/rust/issues/144093
2025-07-22 10:26:13 +02:00
Matthias Krüger
ed92e53803 Rollup merge of #142454 - tomtor:avr-update, r=tgross35
Add modern AVR mcus like avr128db28 and attiny3224

Related to https://github.com/llvm/llvm-project/pull/143914

r? ```@Patryk27```
2025-07-22 10:26:12 +02:00
Josh Triplett
551cb9f1f4 mbe: Use concrete type for get_unused_rule
Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put
it on the concrete `MacroRulesMacroExpander`, and downcast to that type
via `Any` in order to call it.

Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2025-07-22 00:36:10 -07:00
Makai
6df15a172e update SUMMARY.md 2025-07-22 14:59:46 +08:00
Camille GILLOT
3c81faec23 Implement AST visitors using a derive macro. 2025-07-22 01:52:34 +00:00
Camille GILLOT
b1d88ba086 Keep elaborating predicates. 2025-07-22 01:51:11 +00:00
Camille GILLOT
6e8762f769 Use less HIR in check_private_in_public. 2025-07-22 01:40:45 +00:00
Ben Kimock
c4eb077616 Ensure we codegen and don't internalize the entrypoint 2025-07-21 19:54:37 -04:00
bors
9748d87dc7 Auto merge of #144269 - jieyouxu:rollup-137ysl2, r=jieyouxu
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#142097 (gpu offload host code generation)
 - rust-lang/rust#143430 (Lower extra lifetimes before normal generic params.)
 - rust-lang/rust#143768 (Constify Try, From, TryFrom and relevant traits)
 - rust-lang/rust#143816 (Implement `check` for compiletest and RA using tool macro)
 - rust-lang/rust#143985 (rustc_public: de-StableMIR-ize)
 - rust-lang/rust#144027 (clippy: make tests work in stage 1)
 - rust-lang/rust#144080 (Mitigate `#[align]` name resolution ambiguity regression with a rename)
 - rust-lang/rust#144176 (Add approval blocking labels for new bors)
 - rust-lang/rust#144187 (fix handling of base address for TypeId allocations)
 - rust-lang/rust#144212 (Remove the ptr_unique lang item)
 - rust-lang/rust#144243 (Subtree update of `rust-analyzer`)
 - rust-lang/rust#144246 (Don't use another main test file as auxiliary)
 - rust-lang/rust#144251 (rustc-dev-guide subtree update)
 - rust-lang/rust#144254 (opt-dist: make `artifact-dir` an absolute path for `opt-dist local`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-21 19:48:22 +00:00
Noratrieb
dad96b107c Use serde for target spec json deserialize
The previous manual parsing of `serde_json::Value` was a lot of
complicated code and extremely error-prone. It was full of janky
behavior like sometimes ignoring type errors, sometimes erroring for
type errors, sometimes warning for type errors, and sometimes just
ICEing for type errors (the icing on the top).

Additionally, many of the error messages about allowed values were out
of date because they were in a completely different place than the
FromStr impls. Overall, the system caused confusion for users.

I also found the old deserialization code annoying to read. Whenever a
`key!` invocation was found, one had to first look for the right macro
arm, and no go to definition could help.

This PR replaces all this manual parsing with a 2-step process involving
serde.
First, the string is parsed into a `TargetSpecJson` struct. This struct
is a 1:1 representation of the spec JSON. It already parses all the
enums and is very simple to read and write.
Then, the fields from this struct are copied into the actual `Target`.
The reason for this two-step process instead of just serializing into a
`Target` is because of a few reasons

 1. There are a few transformations performed between the two formats
 2. The default logic is implemented this way. Otherwise all the default
    field values would have to be spelled out again, which is
    suboptimal. With this logic, they fall out naturally, because
    everything in the json struct is an `Option`.

Overall, the mapping is pretty simple, with the vast majority of fields
just doing a 1:1 mapping that is captured by two macros. I have
deliberately avoided making the macros generic to keep them simple.

All the `FromStr` impls now have the error message right inside them,
which increases the chance of it being up to date. Some "`from_str`"
impls were turned into proper `FromStr` impls to support this.

The new code is much less involved, delegating all the JSON parsing
logic to serde, without any manual type matching.

This change introduces a few breaking changes for consumers. While it is
possible to use this format on stable, it is very much subject to
change, so breaking changes are expected. The hope is also that because
of the way stricter behavior, breaking changes are easier to deal with,
as they come with clearer error messages.

1. Invalid types now always error, everywhere. Previously, they would
   sometimes error, and sometimes just be ignored (which meant the users
   JSON was still broken, just silently!)
2. This now makes use of `deny_unknown_fields` instead of just warning
   on unused fields, which was done previously. Serde doesn't make it
   easy to get such warning behavior, which was the primary reason that
   this now changed. But I think error behavior is very reasonable too.
   If someone has random stale fields in their JSON, it is likely
   because these fields did something at some point but no longer do,
   and the user likely wants to be informed of this so they can figure
   out what to do.

   This is also relevant for the future. If we remove a field but
   someone has it set, it probably makes sense for them to take a look
   whether they need this and should look for alternatives, or whether
   they can just delete it. Overall, the JSON is made more explicit.

This is the only expected breakage, but there could also be small
breakage from small mistakes. All targets roundtrip though, so it can't
be anything too major.
2025-07-21 19:32:44 +02:00
许杰友 Jieyou Xu (Joe)
6628a4afb5 Rollup merge of #144254 - ognevny:opt-dist-artifact-dir, r=Kobzol
opt-dist: make `artifact-dir` an absolute path for `opt-dist local`

...like for CI environments. the same logic applied as for `build_dir`. fixes the issue where some intermediate steps fail due to path being relative to an active directory

r? Kobzol

try-job: dist-x86_64-msvc
try-job: dist-x86_64-linux
2025-07-22 00:54:33 +08:00
许杰友 Jieyou Xu (Joe)
43fa3f555e Rollup merge of #144251 - tshepang:rdg-sync, r=jieyouxu
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to cca233729f.

Created using https://github.com/rust-lang/josh-sync.

r? ```@ghost```
2025-07-22 00:54:32 +08:00
许杰友 Jieyou Xu (Joe)
55a477efb2 Rollup merge of #144246 - jieyouxu:no-dual-test, r=lqd,RalfJung
Don't use another main test file as auxiliary

In this case, the exact extern crate isn't very important, it just needs to not be another main test file.

This is part of the changes needed to address the spurious failures from a main test `../removing-extern-crate.rs` being both an auxiliary and a main test file, causing fs races due to multiple `rustc` processes in multiple test threads trying to build the main test file both as a main test and also as an auxiliary at around the same time.

Part 1 of rust-lang/rust#144237.

r? ``@RalfJung`` (or compiler)
2025-07-22 00:54:32 +08:00