Commit Graph

283695 Commits

Author SHA1 Message Date
Nicholas Nethercote
ff0a5fe975 Remove #![warn(unreachable_pub)] from all compiler/ crates.
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-11 13:14:21 +11:00
Nicholas Nethercote
55505ab1d3 Add unreachable_pub to RUSTC_LINT_FLAGS for compiler/ crates.
And fix the new errors in the handful of crates that didn't have a
`#![warn(unreachable_pub)]`.
2025-03-11 13:14:21 +11:00
Nicholas Nethercote
c9c8387955 Use RUSTC_LINT_FLAGS more.
For the `Mode::Rustc` lints as well. Because, unlike `RUSTC_FLAGS`,
`RUSTC_LINT_FLAGS` is not ignored for proc macro crates.

Fixes #138106.
2025-03-11 13:14:09 +11:00
bors
9fb94b32df Auto merge of #138310 - matthiaskrgr:rollup-zvbpuei, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #137931 (Add remark for missing `llvm-tools` component re. `rustc_private` linker failures related to not finding LLVM libraries)
 - #138138 (Pass `InferCtxt` to `InlineAsmCtxt` to properly taint on error)
 - #138223 (Fix post-merge workflow)
 - #138268 (Handle empty test suites in GitHub job summary report)
 - #138278 (Delegation: fix ICE with invalid `MethodCall` generation)
 - #138281 (Fix O(tests) stack usage in edition 2024 mergeable doctests)
 - #138305 (Subtree update of `rust-analyzer`)
 - #138306 (Revert "Use workspace lints for crates in `compiler/` #138084")

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-10 18:38:06 +00:00
Matthias Krüger
44ec67fffb
Rollup merge of #138306 - jieyouxu:revert-workspace-lints, r=Noratrieb
Revert "Use workspace lints for crates in `compiler/` #138084"

Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). The problem is that the `rustc-src` component doesn't include the root `Cargo.toml` manifest.

This breakage was reported in https://github.com/rust-lang/rust/issues/138304.

This reverts commit 48caf81484, reversing changes made to c6662879b2.

cc `@RalfJung`

r? `@nnethercote` (sorry, I didn't consider this being a thing 💀)
2025-03-10 15:57:22 +01:00
Matthias Krüger
2abeceeb97
Rollup merge of #138305 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-03-10 15:57:19 +01:00
Matthias Krüger
d1a875cd37
Rollup merge of #138281 - saethlin:mergeable-doctests-stacksize, r=GuillaumeGomez
Fix O(tests) stack usage in edition 2024 mergeable doctests

Fixes https://github.com/rust-lang/rust/issues/138248

The important change here is that we are not passing a potentially-large array by value. Between the fact that `TestFn` cannot be `Clone` and `test_main` takes a `Vec<TestDescAndFn>`, the only way to call `test::test_main` without O(tests) stack use is to call `Vec::push` many times.

The normal test harness does not have this problem because it calls `test_main_static` or `test_main_static_abort`, which take `&[TestDescAndFn]`. Changing `test::test_main` to take a slice is not a simple change, so I'm avoiding doing it here.
2025-03-10 15:57:15 +01:00
Matthias Krüger
0d6311931b
Rollup merge of #138278 - Bryanskiy:delegation-ice-1, r=petrochenkov
Delegation: fix ICE with invalid `MethodCall` generation

`ExprKind::MethodCall` is now generated instead of `ExprKind::Call` if
- the resolved function has a `&self` argument
- the resolved function is an associated item <- was missed before

Fixes https://github.com/rust-lang/rust/issues/128190
Fixes https://github.com/rust-lang/rust/issues/128119
Fixes https://github.com/rust-lang/rust/issues/127916

r? `@petrochenkov`
2025-03-10 15:57:14 +01:00
Matthias Krüger
5717cc9ef7
Rollup merge of #138268 - Kobzol:fix-summary-nan, r=jieyouxu
Handle empty test suites in GitHub job summary report

Should fix [NaN](https://github.com/rust-lang-ci/rust/actions/runs/13739044506#summary-38426140405)s being printed.

r? `@jieyouxu`
2025-03-10 15:57:12 +01:00
Matthias Krüger
739672cf16
Rollup merge of #138223 - Kobzol:fix-post-merge, r=marcoieni
Fix post-merge workflow

I forgot that `actions/checkout` only checks out a single commit by default. I also forgot to set the environment variable required for the `gh` CLI commands.

I did a few more tests on my fork and hopefully now it should work properly. I also tested it with fake rollup PRs and the comment was sent only to the merged rollup, as it should be.

r? `@marcoieni`
2025-03-10 15:57:10 +01:00
Matthias Krüger
69c7e3664d
Rollup merge of #138138 - compiler-errors:inline-asm-tainting, r=oli-obk
Pass `InferCtxt` to `InlineAsmCtxt` to properly taint on error

Pass an `InferCtxt` into the `InlineAsmCtxt` so that we can use the right dcx to taint the infcx properly, so that we don't try to build invalid MIR for inline asm blocks.

Fixes #138130

Shares the first commit with #137502.

r? oli-obk
2025-03-10 15:57:09 +01:00
Matthias Krüger
150e88c549
Rollup merge of #137931 - xizheyin:issue-137421, r=jieyouxu
Add remark for missing `llvm-tools` component re. `rustc_private` linker failures related to not finding LLVM libraries

Fixes #137421
2025-03-10 15:57:08 +01:00
Michael Goulet
bc4f0bb486 Pass InferCtxt to InlineAsmCtxt to properly taint on error
Split up some of the tests bc tainting causes some errors to become
suppressed
2025-03-10 14:28:09 +00:00
Bryanskiy
61122d1829 Delegation: fix ICE with invalid MethodCall generation 2025-03-10 17:08:29 +03:00
xizheyin
dc576cb67f
Add remark for missing llvm-tools component re. rustc_private linker failures related to not finding LLVM libraries
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-10 21:08:25 +08:00
许杰友 Jieyou Xu (Joe)
063ef18fdc Revert "Use workspace lints for crates in compiler/ #138084"
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to
consider options that avoids breaking downstream usages of cargo on
distributed `rustc-src` artifacts, where such cargo invocations fail due
to inability to inherit `lints` from workspace root manifest's
`workspace.lints` (this is only valid for the source rust-lang/rust
workspace, but not really the distributed `rustc-src` artifacts).

This breakage was reported in
<https://github.com/rust-lang/rust/issues/138304>.

This reverts commit 48caf81484, reversing
changes made to c6662879b2.
2025-03-10 18:12:47 +08:00
Laurențiu Nicola
52f39ffe83
Merge pull request #19331 from lnicola/sync-from-rust
minor: Sync from downstream
2025-03-10 09:52:17 +00:00
Laurențiu Nicola
1d983bf794 Format code 2025-03-10 11:37:21 +02:00
Lukas Wirth
af32b22982
Merge pull request #19328 from Veykril/push-umwykvoskvyp
internal: Run proc-macro server tests as separate CI job
2025-03-10 09:30:22 +00:00
Laurențiu Nicola
c372c55f2b Fix simd layout test 2025-03-10 11:21:03 +02:00
Laurențiu Nicola
87d5bf2b92 Bump rustc crates 2025-03-10 11:20:56 +02:00
Lukas Wirth
ee79f3e9dc Run proc-macro server tests are separate CI job
Touch tt
2025-03-10 10:16:32 +01:00
Lukas Wirth
1c8acd4b7f
Merge pull request #19330 from ChayimFriedman2/normalize-projection
fix: Normalize projections in evaluated const display and layout calculation
2025-03-10 09:15:35 +00:00
Jakub Beránek
1483cb67d9 Handle empty test suites in job summary report 2025-03-10 10:07:03 +01:00
Lukas Wirth
44fad0b1d6
Merge pull request #19079 from ChayimFriedman2/rename-conflict
feat: Warn the user when a rename will change the meaning of the program
2025-03-10 08:59:43 +00:00
Lukas Wirth
f53d1eba48
Merge pull request #19327 from Veykril/push-qyyvkulltzpz
Fix `path` macro hygiene
2025-03-10 08:45:04 +00:00
Laurențiu Nicola
e1da1b09bf Merge from rust-lang/rust 2025-03-10 10:41:53 +02:00
Laurențiu Nicola
fdee1c1455 Preparing for merge from rust-lang/rust 2025-03-10 10:41:28 +02:00
bors
2b285cd5f0 Auto merge of #138200 - weihanglo:update-cargo, r=weihanglo
Update cargo

22 commits in 2622e844bc1e2e6123e54e94e4706f7b6195ce3d..ab1463d632528e39daf35f263e10c14cbe590ce8
2025-02-28 12:33:57 +0000 to 2025-03-08 01:45:05 +0000
- test: redact host target when comparing CARGO_ENV path (rust-lang/cargo#15279)
- feat: add completions for install --path (rust-lang/cargo#15266)
- fix(package): report lockfile / workspace manifest is dirty  (rust-lang/cargo#15276)
- feat(tree): Add `--depth public` behind `-Zunstable-options` (rust-lang/cargo#15243)
- Don't use `$CARGO_BUILD_TARGET` in `cargo metadata` (rust-lang/cargo#15271)
- feat: show extra build description from bootstrap (rust-lang/cargo#15269)
- Upgrade to `rustc-stable-hash v0.1.2` (rust-lang/cargo#15268)
- fix: Respect --frozen everywhere --offline or --locked is accepted (rust-lang/cargo#15263)
- feat(tree): Color the output (rust-lang/cargo#15242)
- fix(vendor): dont remove non-cached source  (rust-lang/cargo#15260)
- docs: lockfile is always included since 1.84 (rust-lang/cargo#15257)
- Remove `Cargo.toml` from `package.include` in example (rust-lang/cargo#15253)
- Small cleanup: remove unneeded result (rust-lang/cargo#15256)
- Fix typo in build-scripts.md (rust-lang/cargo#15254)
- chore(deps): update rust crate pulldown-cmark to 0.13.0 (rust-lang/cargo#15250)
- chore(deps): update compatible (rust-lang/cargo#15249)
- feat(cli): forward bash completions of third party subcommands (rust-lang/cargo#15247)
- feat: add completions for `--lockfile-path` (rust-lang/cargo#15238)
- fix: reset $CARGO if the running program is real `cargo[.exe]`  (rust-lang/cargo#15208)
- Get all members as `available targets` even though default-members was specified. (rust-lang/cargo#15199)
- refactor: control byte display precision with std::fmt options (rust-lang/cargo#15246)
- fix(package): Ensure we can package directories ending with '.rs' (rust-lang/cargo#15240)
2025-03-10 08:31:27 +00:00
Lukas Wirth
7ee9ce8480 Fix path macro hygiene 2025-03-10 09:29:27 +01:00
Lukas Wirth
c961ee6456
Merge pull request #19311 from aibaars/log-build-script-error
Log build script error output in `load_cargo::load_workspace_at`
2025-03-10 08:16:10 +00:00
Lukas Wirth
71b9103ea2
Merge pull request #19314 from snprajwal/variantdef-impl
fix(hir): `VariantDef` is `impl HasSource`
2025-03-10 08:13:24 +00:00
Lukas Wirth
b2a4f3dcef
Merge pull request #19316 from snprajwal/git-commit-ec
fix: do not apply editorconfig to git commit msg
2025-03-10 08:11:48 +00:00
Lukas Wirth
b2501efad5
Merge pull request #19252 from flodiebold/fix-fixup-delimiters
Fix syntax fixup producing invalid punctuation
2025-03-10 08:11:27 +00:00
Lukas Wirth
f36e2ead55
Merge pull request #19232 from ShoyuVanilla/issue-19196
Bump chalk for built-in supports of async closures
2025-03-10 08:11:23 +00:00
Lukas Wirth
129545f41c
Merge pull request #19325 from Veykril/push-sxyvwwsmtxrr
Rank ADT constructors as constructors for completion scoring
2025-03-10 05:59:23 +00:00
bors
2c6a12ec44 Auto merge of #136780 - joboet:move_pal_stdio, r=Amanieu
std: move stdio to `sys`

As per #117276, this moves the platform definitions of `Stdout` and friends into `sys`. This PR also unifies the UNIX and Hermit implementations and moves the `__rust_print_err` function needed by libunwind on SGX into the dedicated module for such helper functions.
2025-03-10 04:32:14 +00:00
Ben Kimock
295c70ef03 Fix O(tests) stack usage in edition 2024 mergeable doctests 2025-03-10 00:04:08 -04:00
bors
c8a5072028 Auto merge of #137899 - notriddle:merged-doctests-stable, r=fmease,GuillaumeGomez
doctests: fix merging on stable

Fixes #137898

The generated multi-test harness relies on nightly-only APIs, so the only way to run it on stable is to enable them.

To prevent the executing test case from getting at any of the stuff that the harness uses, they're built as two separate crates. The test bundle isn't built with RUSTC_BOOTSTRAP, while the runner harness is.
2025-03-10 01:25:19 +00:00
Michael Howell
9cf531d26f
doctests: build test bundle and harness separately
This prevents the included test case from getting at nightly-only
features when run on stable. The harness builds with
RUSTC_BOOTSTRAP, but the bundle doesn't.
2025-03-10 01:47:36 +01:00
Michael Howell
5d6eeea5f9
doctests: fix merging on stable
Fixes #137898

The generated multi-test harness relies on nightly-only APIs,
so the only way to run it on stable is to enable them. Since
tests that use crate attrs don't be merged, there's no way to use
nightly-only features on it anyway.
2025-03-10 01:43:14 +01:00
joboet
c52e0596c5
std: move stdio to sys
As per #117276, this moves the platform definitions of `Stdout` and friends into `sys`. This PR also unifies the UNIX and Hermit implementations and moves the `__rust_print_err` function needed by libunwind on SGX into the dedicated module for such helper functions.
2025-03-09 23:42:13 +01:00
bors
2b4694a698 Auto merge of #137695 - nnethercote:always-inline-query_get_at, r=saethlin
Always inline `query_get_at`.

r? `@saethlin`
2025-03-09 21:36:57 +00:00
bors
3ea711f17e Auto merge of #138279 - matthiaskrgr:rollup-ndnoipr, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #122790 (Apply dllimport in ThinLTO)
 - #137650 (Move `fs` into `sys`)
 - #138228 (Use `disjoint_bitor` inside `borrowing_sub`)
 - #138233 (Windows: Don't link std (and run-make) against advapi32, except on win7)
 - #138253 (Continue to check attr if meet empty repr for adt)
 - #138263 (Fix `repr128-dwarf` test)
 - #138276 (Lazy load NtOpenFile for UWP)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-09 18:32:36 +00:00
Matthias Krüger
33530e4cb9
Rollup merge of #138276 - bdbai:fix-uwp-ntopenfile, r=ChrisDenton
Lazy load NtOpenFile for UWP

Lazily load `NtOpenFile` to allow libraries targeting UWP to build and link.

Fixes #138257 .

r? `@ChrisDenton`
2025-03-09 16:41:54 +01:00
Matthias Krüger
1105f4ac99
Rollup merge of #138263 - beetrees:fix-repr128-dwarf, r=jieyouxu
Fix `repr128-dwarf` test

The test now correctly ignores enums from `std`.

Fixes #138254
Unblocks #138200
2025-03-09 16:41:53 +01:00
Matthias Krüger
469f48db7f
Rollup merge of #138253 - mu001999-contrib:fix-138241, r=jdonszelmann
Continue to check attr if meet empty repr for adt

Fixes #138241

Returning while checking ReprEmpty results in missing the check for the next repr
2025-03-09 16:41:53 +01:00
Matthias Krüger
980a529164
Rollup merge of #138233 - smmalis37:no-advapi32, r=ChrisDenton
Windows: Don't link std (and run-make) against advapi32, except on win7

Std no longer depends on any functionality provided by advapi32, so we can remove it from the list of external libraries we link against. Except, the win7 targets do still rely on advapi32-provided functionality. This PR therefore moves linking against it to only occur on win7 targets, so that no new uses of it slip in without being noticed.
2025-03-09 16:41:52 +01:00
Matthias Krüger
2460fc68b9
Rollup merge of #138228 - TDecking:master, r=jhpratt
Use `disjoint_bitor` inside `borrowing_sub`

This makes the definition of `borrowing_sub` consistent with that of `carrying_add`.
2025-03-09 16:41:51 +01:00
Matthias Krüger
3bc41aa3e6
Rollup merge of #137650 - thaliaarchi:move-fs-pal, r=Noratrieb
Move `fs` into `sys`

Move platform definitions of `fs` into `std::sys`, as part of https://github.com/rust-lang/rust/issues/117276.

cc `@joboet`
2025-03-09 16:41:49 +01:00