about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-15Rollup merge of #138502 - petrochenkov:resinstab, r=compiler-errorsMatthias Krüger-41/+51
resolve: Avoid some unstable iteration This PR replaces https://github.com/rust-lang/rust/pull/131213.
2025-03-15Rollup merge of #138439 - weihanglo:argmax, r=jieyouxuMatthias Krüger-6/+41
feat: check ARG_MAX on Unix platforms On Unix the limits can be gargantuan anyway so we're pretty unlikely to hit them, but might still exceed it. We consult ARG_MAX here to get an estimate. Fixes #138421 r? `@jieyouxu`
2025-03-15Rollup merge of #138283 - compiler-errors:enforce-const-param, r=BoxyUwUMatthias Krüger-0/+99
Enforce type of const param correctly in MIR typeck Properly intercepts and then annotates the type for a `ConstKind::Param` in the MIR. This code should probably be cleaned up, it's kinda spaghetti, but no better structure really occurred to me when writing this case. We could probably gate this behind the feature gate or add a fast path when the args have no free regions if perf is bad. r? `@BoxyUwU`
2025-03-15Auto merge of #138379 - estebank:macro-backtrace-note, r=petrochenkovbors-495/+27
Do not suggest using `-Zmacro-backtrace` for builtin macros For macros that are implemented on the compiler, or that are annotated with `rustc_diagnostic_item`, which have arbitrary implementations from the point of view of the user and might as well be intrinsics, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros like `panic!` and `format!`. This PR adds a field to every `Span`'s `ExpnData` stating whether it comes from a builtin macro. This is determined by the macro being annotated with either `#[rustc_builtin_macro]` or `#[rustc_diagnostic_item]`. An alternative to using these attributes that already exist for other uses would be to introduce another attribute like `#[rustc_no_backtrace]` to have finer control on which macros are affected (for example, an error within `vec![]` now doesn't mention the backtrace, but one could make the case that it should). Ideally, instead of carrying this information in the `ExpnData` we'd instead try to query the `DefId` of the macro (that is already stored) to see if it is annotated in some way, but we do not have access to the `TyCtxt` from `rustc_errors`. r? `@petrochenkov`
2025-03-15Auto merge of #138523 - fmease:rollup-j2j5h59, r=fmeasebors-210/+486
Rollup of 9 pull requests Successful merges: - #138056 (rustc_target: Add target features for LoongArch v1.1) - #138451 (Build GCC on CI with GCC, not Clang) - #138454 (Improve post-merge workflow) - #138460 (Pass struct field HirId when check_expr_struct_fields) - #138474 (Refactor is_snake_case.) - #138482 (Fix HIR printing of parameters) - #138507 (Mirror NetBSD sources) - #138511 (Make `Parser::parse_expr_cond` public) - #138518 (Fix typo in hir lowering lint diag) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-15Rollup merge of #138518 - yotamofek:pr/hir-lint-typo, r=compiler-errorsLeón Orell Valerian Liehr-14/+16
Fix typo in hir lowering lint diag
2025-03-15Rollup merge of #138511 - mohe2015:rustc-parse-pub-parse-expr-cond, r=oli-obkLeón Orell Valerian Liehr-1/+2
Make `Parser::parse_expr_cond` public This allows usage in rustfmt and rustfmt forks. I'm using this for custom macro formatting, see https://github.com/tucant/rustfmt/blob/30c83df9e1db10007bdd16dafce8a86b404329b2/src/parse/macros/html.rs#L57 It would be great if this could be upstreamed so I don't need to rely on a fork.
2025-03-15Rollup merge of #138507 - Kobzol:netbsd-mirror, r=Mark-SimulacrumLeón Orell Valerian Liehr-17/+9
Mirror NetBSD sources Should avoid issues with NetBSD servers. r? ``@Mark-Simulacrum`` try-job: `*netbsd*`
2025-03-15Rollup merge of #138482 - nnethercote:fix-hir-printing, r=compiler-errorsLeón Orell Valerian Liehr-24/+115
Fix HIR printing of parameters HIR pretty printing does the wrong thing for anonymous parameters, and there is no test coverage for it. This PR remedies both of those things. r? ``@lcnr``
2025-03-15Rollup merge of #138474 - remexre:refactor-is-snake-case, r=compiler-errorsLeón Orell Valerian Liehr-12/+7
Refactor is_snake_case. I wondered what the definition of this actually was, and found the original hard to read. I believe this change preserves the original behavior, but is hopefully clearer.
2025-03-15Rollup merge of #138460 - xizheyin:issue-138319, r=petrochenkovLeón Orell Valerian Liehr-3/+74
Pass struct field HirId when check_expr_struct_fields Fixes #138319 r? compiler cc ``@Mark-Simulacrum``
2025-03-15Rollup merge of #138454 - Kobzol:post-merge-workflow-fixes, r=jieyouxuLeón Orell Valerian Liehr-78/+144
Improve post-merge workflow Contains various fixes for the post-merge workflow implemented in https://github.com/rust-lang/rust/pull/138013, which were suggested on Zulip. This PR changes the grouping of test diffs and ignores doctests, as they are too noisy. I'll post an example output (before/after this PR) in comments below. r? ```@jieyouxu```
2025-03-15Rollup merge of #138451 - Kobzol:gcc-ci-build-gcc, r=GuillaumeGomezLeón Orell Valerian Liehr-45/+91
Build GCC on CI with GCC, not Clang It seems that GCC built with Clang misbehaves. I have tested that cg_gcc tests [pass](https://github.com/rust-lang/rust/actions/runs/13842365913/job/38732750617?pr=138451) on CI with a downloaded GCC that was built in this way. Prerequisite for https://github.com/rust-lang/rust/pull/138395. r? ```@ghost```
2025-03-15Rollup merge of #138056 - heiher:loong64v1.1-features, r=petrochenkovLeón Orell Valerian Liehr-16/+28
rustc_target: Add target features for LoongArch v1.1 This patch adds new target features for LoongArch v1.1: * div32 * lam-bh * lamcas * ld-seq-sa * scq
2025-03-14Auto merge of #138519 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 15 commits in ab1463d632528e39daf35f263e10c14cbe590ce8..6cf8267012570f63d6b86e85a2ae5627de52df9e 2025-03-08 01:45:05 +0000 to 2025-03-14 15:25:36 +0000 - feat(package): add --exclude-lockfile flag (rust-lang/cargo#15234) - Redox OS is part of the unix family (rust-lang/cargo#15307) - docs(ref): Mention `x.y.*` as a kind of version requirement to avoid. (rust-lang/cargo#15310) - fix(run): Disambiguate bins from different packages that share a name (rust-lang/cargo#15298) - cargo vendor: Add context which workspace failed to resolve (rust-lang/cargo#15297) - docs(ref): Note that target-edition is deprecated (rust-lang/cargo#15292) - refactor(toml): Centralize target descriptions (rust-lang/cargo#15291) - docs(refs): Add `unsafe` to `extern` while using build scripts in Cargo Book (rust-lang/cargo#15294) - Replace unmaintained humantime crate with jiff (rust-lang/cargo#15290) - Add terminal integration via ANSI OSC 9;4 sequences (rust-lang/cargo#14615) - feat: add completions for add --path (rust-lang/cargo#15288) - Allow `term.progress.when` to default (rust-lang/cargo#15287) - docs: spelling and grammar fixes (rust-lang/cargo#15284) - chore(deps): update cargo-semver-checks to v0.40.0 (rust-lang/cargo#15282) - Typo fixes (rust-lang/cargo#15280) r? ghost
2025-03-14Small grammar fix in commentYotam Ofek-1/+1
2025-03-14Fix typo in hir lowering lint diagYotam Ofek-13/+15
2025-03-14Update cargoWeihang Lo-0/+0
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-495/+27
For macros that are implemented on the compiler, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros.
2025-03-14Make `Parser::parse_expr_cond` public.Moritz Hedtke-1/+2
This allows usage in rustfmt and rustfmt forks.
2025-03-14Auto merge of #138506 - fmease:rollup-ve4h2eq, r=fmeasebors-134/+264
Rollup of 9 pull requests Successful merges: - #134720 (Display valid crate types in error message for --crate-type flag) - #137619 (Provide helpful diagnostics for shebang lookalikes) - #138353 (remove must_use from <*const T>::expose_provenance) - #138452 (Remove `RUN_CHECK_WITH_PARALLEL_QUERIES`) - #138469 (remove comment regarding a removed test directive) - #138477 (Deny impls for `BikeshedGuaranteedNoDrop`) - #138485 (Rustc dev guide subtree update) - #138487 (Pass `CI_JOB_DOC_URL` to Docker) - #138495 (Take a break from reviews) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-14Mirror NetBSD sourcesJakub Beránek-17/+9
2025-03-14Rollup merge of #138495 - ChrisDenton:vacate, r=ChrisDentonLeón Orell Valerian Liehr-0/+1
Take a break from reviews
2025-03-14Rollup merge of #138487 - Kobzol:fix-doc-url-docker, r=marcoieniLeón Orell Valerian Liehr-0/+1
Pass `CI_JOB_DOC_URL` to Docker Fix-up for https://github.com/rust-lang/rust/pull/136911. I always forget to pass new environment variables to Docker images.. :man_facepalming: r? `@marcoieni` try-job: x86_64-fuchsia
2025-03-14Rollup merge of #138485 - BoxyUwU:rdg-push, r=jieyouxuLeón Orell Valerian Liehr-105/+202
Rustc dev guide subtree update r? `@jieyouxu`
2025-03-14Rollup merge of #138477 - compiler-errors:deny-bikeshed-guaranteed-no-drop, ↵León Orell Valerian Liehr-1/+5
r=lcnr Deny impls for `BikeshedGuaranteedNoDrop` r? lcnr
2025-03-14Rollup merge of #138469 - tshepang:patch-6, r=onur-ozkanLeón Orell Valerian Liehr-2/+0
remove comment regarding a removed test directive Removed in https://github.com/rust-lang/rust/pull/120265
2025-03-14Rollup merge of #138452 - Kobzol:remove-run-check-with-parallel-queries, ↵León Orell Valerian Liehr-17/+0
r=Mark-Simulacrum,onur-ozkan Remove `RUN_CHECK_WITH_PARALLEL_QUERIES` After https://github.com/rust-lang/rust/pull/132282, I'm pretty sure that this is simply useless? It just runs check with an empty config, lol. CC `@onur-ozkan` r? `@Noratrieb`
2025-03-14Rollup merge of #138353 - RalfJung:expose-provenance-must-use, r=ibraheemdevLeón Orell Valerian Liehr-1/+0
remove must_use from <*const T>::expose_provenance `<*mut T>::expose_provenance` does not have this attribute, and in fact the function is documented to have a side-effect, so there are perfectly legitimate use-cases where the return value would be ignored.
2025-03-14Rollup merge of #137619 - Pyr0de:issue_137249, r=fmeaseLeón Orell Valerian Liehr-1/+37
Provide helpful diagnostics for shebang lookalikes When `[` is not found after a `#!`, a note will be added to the exisiting error ``` error: expected `[`, found `/` --> src/main.rs:2:3 | 2 | #!/usr/bin/env -S cargo +nightly -Zscript | ^ expected `[` | = note: the token sequence `#!` here looks like the start of a shebang interpreter directive but it is not = help: if you meant this to be a shebang interpreter directive, move it to the very start of the file ``` Fixes #137249 r? `@fmease`
2025-03-14Rollup merge of #134720 - malezjaa:feat/crate-type-valid-values, r=jieyouxuLeón Orell Valerian Liehr-7/+18
Display valid crate types in error message for --crate-type flag This PR improves the error message for the --crate-type flag. When an invalid crate type is provided, the compiler will now show a list of valid options. ### Before ![image](https://github.com/user-attachments/assets/4922e4e5-eeca-40cd-ac1c-1c6319a81aee) ### After ![image](https://github.com/user-attachments/assets/67ea1f35-aa41-4e4f-8691-47c273d0cff9) I based the implementation on `OutputType::shorthands_display` Closes #70183
2025-03-14resolve: Avoid some unstable iterationVadim Petrochenkov-41/+51
2025-03-14Auto merge of #137424 - Ayush1325:uefi-path-node, r=nicholasbishop,cuviperbors-0/+179
uefi: helpers: Add DevicePathNode abstractions - UEFI device path is a series of nodes layed out in a contiguous memory region. So it makes sense to use Iterator abstraction for modeling DevicePaths - This PR has been split off from #135368 for easier review. The allow dead_code will be removed in #135368 cc `@nicholasbishop`
2025-03-14feat(linker): check ARG_MAX on Unix platformsWeihang Lo-7/+41
On Unix the limits can be gargantuan anyway so we're pretty unlikely to hit them, but might still exceed it. We consult ARG_MAX here to get an estimate.
2025-03-14fix(linker): use arg list estimate on only WindowsWeihang Lo-1/+1
Though I doubt anyone running rustc outside Unix/Windows
2025-03-14fix(linker): prevent overflow when estimating CLI arg list lengthWeihang Lo-1/+2
This also updates the estimate on Windows of the length argument list to `saturating_add` to avoid overflow.
2025-03-14Take a break from reviewsChris Denton-0/+1
2025-03-14Remove `RUN_CHECK_WITH_PARALLEL_QUERIES`Jakub Beránek-17/+0
It is useless after the removal of the parallel compiler configuration.
2025-03-14Pass `CI_JOB_DOC_URL` to DockerJakub Beránek-0/+1
2025-03-14Ensure that GCC is not built using Clang, as it misbehavesJakub Beránek-6/+20
2025-03-14Add clarification about doctestsJakub Beránek-1/+1
2025-03-14Merge pull request #2283 from jieyouxu/sync许杰友 Jieyou Xu (Joe)-51657/+86211
Rustc pull
2025-03-14Show valid crate types when the user passes unknown `--crate-type` valuemalezjaa-7/+18
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
2025-03-14Auto merge of #138480 - jhpratt:rollup-y3b8wu5, r=jhprattbors-212/+488
Rollup of 16 pull requests Successful merges: - #136001 (Overhaul examples for PermissionsExt) - #136230 (Reword incorrect documentation about SocketAddr having varying layout) - #136892 (Sync Fuchsia target spec with clang Fuchsia driver) - #136911 (Add documentation URL to selected jobs) - #137870 ( Improve HashMap docs for const and static initializers) - #138179 (Add `src/tools/x` to the main workspace) - #138389 (use `expect` instead of `allow`) - #138396 (Enable metrics and verbose tests in PR CI) - #138398 (atomic intrinsics: clarify which types are supported and (if applicable) what happens with provenance) - #138432 (fix: remove the check of lld not supporting `@response-file)` - #138434 (Visit `PatField` when collecting lint levels) - #138441 (update error message) - #138442 (EUV: fix place of deref pattern's interior's scrutinee) - #138457 (Remove usage of legacy scheme paths on RedoxOS) - #138461 (Remove an outdated line from a test comment) - #138466 (Remove myself from libs review) Failed merges: - #138452 (Remove `RUN_CHECK_WITH_PARALLEL_QUERIES`) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-14Pass precise HirId when calling check_stabilityxizheyin-3/+74
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-14Merge pull request #2285 from KonaeAkira/masterTshepang Mbambo-2/+1
Fix grammar and remove redundant info
2025-03-14Rollup merge of #138466 - cuviper:libs-review, r=jieyouxuJacob Pratt-1/+0
Remove myself from libs review Trying to re-balance my work by reducing reviews for now.
2025-03-14Rollup merge of #138461 - WaffleLapkin:indate-comment, r=ehussJacob Pratt-1/+0
Remove an outdated line from a test comment They *used* to not work, however this was fixed in the PR that added the test. I forgot to remove this line or possibly lost its removal while rebasing. r? `@ehuss`
2025-03-14Rollup merge of #138457 - bjorn3:redox_scheme_paths, r=NoratriebJacob Pratt-14/+8
Remove usage of legacy scheme paths on RedoxOS The `name:/path` path syntax is getting phased out[^1] in favor of `/scheme/name/path`. Also using `null:` is no longer necessary as `/dev/null` is available on Redox OS too. [^1]: https://gitlab.redox-os.org/redox-os/rfcs/-/blob/master/text/0006-scheme-path.md cc `@jackpot51`
2025-03-14Rollup merge of #138442 - dianne:deref-pat-euv-fix, r=compiler-errorsJacob Pratt-13/+17
EUV: fix place of deref pattern's interior's scrutinee The place previously used here was that of the temporary holding the reference returned by `Deref::deref` or `DerefMut::deref_mut`. However, since the inner pattern of `deref!(inner)` expects the deref-target type itself, this would ICE when that type was inspected (e.g. by the EUV case for slice patterns). This adds a deref projection to fix that. Since current in-tree consumers of EUV (upvar inference and clippy) don't care about Rvalues, the place could be simplified to `self.cat_rvalue(pat.hir_id, self.pat_ty_adjusted(subpat)?)` to save some cycles. I personally find EUV to be a bit fragile, so I've opted for pedantic correctness. Maybe a `HACK` comment would suffice though? Fixes #125059 r? `@compiler-errors`