about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-11Rollup merge of #135987 - hkBst:patch-20, r=joboetJakub Beránek-3/+15
Clarify iterator by_ref docs fixes #95143
2025-03-11Auto merge of #135651 - arjunr2:master, r=davidtwcobors-20/+352
Support for `wasm32-wali-linux-musl` Tier-3 target Adding a new target -- `wasm32-wali-linux-musl` -- to the compiler can target the [WebAssembly Linux Interface](https://github.com/arjunr2/WALI) according to MCP rust-lang/compiler-team#797 Preliminary support involves minimal changes, primarily * A new target spec for `wasm32_wali_linux_musl` that bridges linux options with supported wasm options. Right now, since there is no canonical Linux ABI for Wasm, we use `wali` in the vendor field, but this can be migrated in future version. * Dependency patches to the following crates are required and these crates can be updated to bring target support: - **stdarch** rust-lang/stdarch#1702 - **libc** rust-lang/libc#4244 - **cc** rust-lang/cc-rs#1373 * Minimal additions for FFI support cc `@tgross35` for libc-related changes Tier-3 policy: > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) I will take responsibility for maintaining this target as well as issues > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. The target name is consistent with naming patterns from currently supported targets for arch (wasm32), OS, (linux) and env (musl) > Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. No naming confusion is introduced. > If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo. Compliant > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. It's fully open source > The target must not introduce license incompatibilities. Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). Noted > The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. Compliant > Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. All tools are open-source > "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. No terms present > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. I am not a reviewer > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. This target supports the full standard library with appropriate configuration stubs where necessary (however, similar to all existing wasm32 targets, it excludes dynamic linking or hardware-specific features) > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. Preliminary documentation is provided at https://github.com/arjunr2/WALI. Further detailed docs (if necessary) can be added once this PR lands > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. Understood > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. To the best of my knowledge, it does not break any existing target in the ecosystem -- only minimal configuration-specific additions were made to support the target. > Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.) We can upstream LLVM target support
2025-03-11Auto merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcmbors-80/+530
Reduce formatting `width` and `precision` to 16 bits This is part of https://github.com/rust-lang/rust/issues/99012 This is reduces the `width` and `precision` fields in format strings to 16 bits. They are currently full `usize`s, but it's a bit nonsensical that we need to support the case where someone wants to pad their value to eighteen quintillion spaces and/or have eighteen quintillion digits of precision. By reducing these fields to 16 bit, we can reduce `FormattingOptions` to 64 bits (see https://github.com/rust-lang/rust/pull/136974) and improve the in memory representation of `format_args!()`. (See additional context below.) This also fixes a bug where the width or precision is silently truncated when cross-compiling to a target with a smaller `usize`. By reducing the width and precision fields to the minimum guaranteed size of `usize`, 16 bits, this bug is eliminated. This is a breaking change, but affects almost no existing code. --- Details of this change: There are three ways to set a width or precision today: 1. Directly a formatting string, e.g. `println!("{a:1234}")` 2. Indirectly in a formatting string, e.g. `println!("{a:width$}", width=1234)` 3. Through the unstable `FormattingOptions::width` method. This PR: - Adds a compiler error for 1. (`println!("{a:9999999}")` no longer compiles and gives a clear error.) - Adds a runtime check for 2. (`println!("{a:width$}, width=9999999)` will panic.) - Changes the signatures of the (unstable) `FormattingOptions::[get_]width` methods to use a `u16` instead. --- Additional context for improving `FormattingOptions` and `fmt::Arguments`: All the formatting flags and options are currently: - The `+` flag (1 bit) - The `-` flag (1 bit) - The `#` flag (1 bit) - The `0` flag (1 bit) - The `x?` flag (1 bit) - The `X?` flag (1 bit) - The alignment (2 bits) - The fill character (21 bits) - Whether a width is specified (1 bit) - Whether a precision is specified (1 bit) - If used, the width (a full usize) - If used, the precision (a full usize) Everything except the last two can simply fit in a `u32` (those add up to 31 bits in total). If we can accept a max width and precision of u16::MAX, we can make a `FormattingOptions` that is exactly 64 bits in size; the same size as a thin reference on most platforms. If, additionally, we also limit the number of formatting arguments, we can also reduce the size of `fmt::Arguments` (that is, of a `format_args!()` expression).
2025-03-10Target definition for `wasm32-wali-linux-musl` to support the Wasm LinuxArjun Ramesh-20/+352
Interface This commit does not patch libc, stdarch, or cc
2025-03-11Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgrbors-178/+436
Rollup of 8 pull requests Successful merges: - #136395 (Update to rand 0.9.0) - #137279 (Make some invalid codegen attr errors structured/translatable) - #137585 (Update documentation to consistently use 'm' in atomic synchronization example) - #137926 (Add a test for `-znostart-stop-gc` usage with LLD) - #138074 (Support `File::seek` for Hermit) - #138238 (Fix dyn -> param suggestion in struct ICEs) - #138270 (chore: Fix some comments) - #138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-10Auto merge of #138310 - matthiaskrgr:rollup-zvbpuei, r=matthiaskrgrbors-2279/+4967
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-10Rollup merge of #138306 - jieyouxu:revert-workspace-lints, r=NoratriebMatthias Krüger-252/+90
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 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028. cc `@RalfJung` r? `@nnethercote` (sorry, I didn't consider this being a thing 💀)
2025-03-10Rollup merge of #138305 - lnicola:sync-from-ra, r=lnicolaMatthias Krüger-1880/+4676
Subtree update of `rust-analyzer` r? `@ghost`
2025-03-10Rollup merge of #138281 - saethlin:mergeable-doctests-stacksize, ↵Matthias Krüger-9/+10
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-10Rollup merge of #138278 - Bryanskiy:delegation-ice-1, r=petrochenkovMatthias Krüger-54/+37
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-10Rollup merge of #138268 - Kobzol:fix-summary-nan, r=jieyouxuMatthias Krüger-3/+7
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-10Rollup merge of #138223 - Kobzol:fix-post-merge, r=marcoieniMatthias Krüger-2/+8
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-10Rollup merge of #138138 - compiler-errors:inline-asm-tainting, r=oli-obkMatthias Krüger-79/+109
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-10Rollup merge of #137931 - xizheyin:issue-137421, r=jieyouxuMatthias Krüger-0/+30
Add remark for missing `llvm-tools` component re. `rustc_private` linker failures related to not finding LLVM libraries Fixes #137421
2025-03-10Pass InferCtxt to InlineAsmCtxt to properly taint on errorMichael Goulet-79/+109
Split up some of the tests bc tainting causes some errors to become suppressed
2025-03-10Delegation: fix ICE with invalid MethodCall generationBryanskiy-54/+37
2025-03-10Add remark for missing llvm-tools component re. rustc_private linker ↵xizheyin-0/+30
failures related to not finding LLVM libraries Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-10Share implementation of expr_u{16,32,size}.Mara Bos-21/+8
2025-03-10Add #[track_caller] to from_usize.Mara Bos-0/+1
2025-03-10Remove unnecessary semicolon.Mara Bos-1/+1
2025-03-10Fix rust-analyzer for 16-bit fmt width and precision.Mara Bos-1/+1
2025-03-10Update tests.Mara Bos-20/+459
2025-03-10Limit formatting width and precision to 16 bits.Mara Bos-46/+69
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-252/+90
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 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-10Merge pull request #19331 from lnicola/sync-from-rustLaurențiu Nicola-16953/+21900
minor: Sync from downstream
2025-03-10Format codeLaurențiu Nicola-35/+43
2025-03-10Merge pull request #19328 from Veykril/push-umwykvoskvypLukas Wirth-25/+45
internal: Run proc-macro server tests as separate CI job
2025-03-10Fix simd layout testLaurențiu Nicola-1/+1
2025-03-10Bump rustc cratesLaurențiu Nicola-25/+20
2025-03-10Run proc-macro server tests are separate CI jobLukas Wirth-25/+45
Touch tt
2025-03-10Merge pull request #19330 from ChayimFriedman2/normalize-projectionLukas Wirth-503/+869
fix: Normalize projections in evaluated const display and layout calculation
2025-03-10Handle empty test suites in job summary reportJakub Beránek-3/+7
2025-03-10Merge pull request #19079 from ChayimFriedman2/rename-conflictLukas Wirth-59/+509
feat: Warn the user when a rename will change the meaning of the program
2025-03-10Merge pull request #19327 from Veykril/push-qyyvkulltzpzLukas Wirth-2/+6
Fix `path` macro hygiene
2025-03-10Merge from rust-lang/rustLaurențiu Nicola-16902/+21846
2025-03-10Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-03-10Rollup merge of #138286 - aDotInTheVoid:aDotInTheVoid-patch-3, r=compiler-errorsMatthias Krüger-1/+1
triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (… Followup to #137958. I managed to miss a place, as shown by the questionable labeling of #138285.
2025-03-10Rollup merge of #138270 - StevenMia:master, r=compiler-errorsMatthias Krüger-6/+6
chore: Fix some comments Fix some comments
2025-03-10Rollup merge of #138238 - compiler-errors:dyn-suggestion-in-struct, ↵Matthias Krüger-38/+150
r=nnethercote Fix dyn -> param suggestion in struct ICEs Makes the logic from #138042 a bit less ICEy and more clean. Also fixes an incorrect suggestion when the struct already has generics. I'll point out the major changes and observations in the code. Fixes #138229 Fixes #138211 r? nnethercote since you reviewed the original pr, or re-roll if you don't want to review this
2025-03-10Rollup merge of #138074 - thaliaarchi:hermit-seek, r=ChrisDentonMatthias Krüger-8/+25
Support `File::seek` for Hermit `lseek` was added in `hermit-abi` in commit [87dd201](https://github.com/hermit-os/hermit-rs/commit/87dd201a14ac7661e1a4b761273e24d750496286) (add missing interface for lseek, 2024-07-15), which was just released in version 0.5.0. cc ``@mkroening,`` ``@stlankes`` Fixes https://github.com/hermit-os/hermit-rs/issues/652
2025-03-10Rollup merge of #137926 - Kobzol:lld-no-start-stop-test, r=lqdMatthias Krüger-0/+25
Add a test for `-znostart-stop-gc` usage with LLD This test replicates the behavior of https://github.com/dtolnay/linkme, to test that it still works even with LLD. Without `-znostart-stop-gc` the test fails. r? ``@lqd`` try-job: x86_64-gnu try-job: x86_64-msvc-1
2025-03-10Rollup merge of #137585 - xizheyin:issue-135801, r=workingjubileeMatthias Krüger-5/+5
Update documentation to consistently use 'm' in atomic synchronization example Fixes #135801
2025-03-10Rollup merge of #137279 - estebank:codegen-structured-errors, r=nnethercoteMatthias Krüger-85/+161
Make some invalid codegen attr errors structured/translatable
2025-03-10Rollup merge of #136395 - ChrisDenton:rand-0-9, r=Mark-SimulacrumMatthias Krüger-35/+63
Update to rand 0.9.0 Changes include: - `thread_rng` has been renamed to `rng` - `Standard` has been renamed to `StandardUniform` - `gen`, `gen_range`, `gen_bool` have been renamed to `random`, `random_range` and `random_bool` respectively.
2025-03-10Auto merge of #138200 - weihanglo:update-cargo, r=weihanglobors-1/+0
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-10Fix `path` macro hygieneLukas Wirth-2/+6
2025-03-10Merge pull request #19311 from aibaars/log-build-script-errorLukas Wirth-0/+8
Log build script error output in `load_cargo::load_workspace_at`
2025-03-10Merge pull request #19314 from snprajwal/variantdef-implLukas Wirth-1/+68
fix(hir): `VariantDef` is `impl HasSource`
2025-03-10Merge pull request #19316 from snprajwal/git-commit-ecLukas Wirth-0/+3
fix: do not apply editorconfig to git commit msg
2025-03-10Merge pull request #19252 from flodiebold/fix-fixup-delimitersLukas Wirth-88/+105
Fix syntax fixup producing invalid punctuation