about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-18Rename optional-mingw-check to optional-pr-checkChris Denton-2/+2
2025-07-18Change the `memcmp` and `bcmp` return type to `c_int`Julien THILLARD-4/+5
Fix the return type of `memcmp` and `bcmp` builtin functions on targets with a `c_int` other than `i32`. Linked issue: https://github.com/rust-lang/rust/issues/144076
2025-07-19rename `emit_unless` to `emit_unless_delay`xizheyin-15/+15
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-18tests: assembly: cstring-merging: Disable GlobalMerge passJens Reidel-1/+1
The test relies on LLVM not merging all the globals into one and would currently otherwise fail on powerpc64le. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-19Mitigate `#[align]` name resolution ambiguity regression with a renameJieyou Xu-255/+270
From `#[align]` -> `#[rustc_align]`. Attributes starting with `rustc` are always perma-unstable and feature-gated by `feature(rustc_attrs)`. See regression RUST-143834. For the underlying problem where even introducing new feature-gated unstable built-in attributes can break user code such as ```rs macro_rules! align { () => { /* .. */ }; } pub(crate) use align; // `use` here becomes ambiguous ``` refer to RUST-134963. Since the `#[align]` attribute is still feature-gated by `feature(fn_align)`, we can rename it as a mitigation. Note that `#[rustc_align]` will obviously mean that current unstable user code using `feature(fn_aling)` will need additionally `feature(rustc_attrs)`, but this is a short-term mitigation to buy time, and is expected to be changed to a better name with less collision potential. See <https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202025-07-17/near/529290371> where mitigation options were considered.
2025-07-18mem: Use `core::ffi::c_int`Trevor Gross-8/+1
This alias was added in 9897bfb8a ("Fix memset arguments for MSP430 target"), which predates `core::ffi`. Now that it exists we can just use `core::ffi::c_int`.
2025-07-18docs: update link to RISC-V and Xtensa installation guideMicke-1/+1
2025-07-18Remove pretty print hack for async blocksMichael Goulet-25/+1
2025-07-18Rollup merge of #144123 - oli-obk:ctfe-unsize, r=RalfJungMatthias Krüger-4/+5
Generalize `unsize` and `unsize_into` destinations Just something that I noticed during other work. We do this for most such functions, so let's do it here, too. r? ``@RalfJung``
2025-07-18Rollup merge of #144059 - LorrensP-2158466:remove-crate-loader, r=petrochenkovMatthias Krüger-158/+169
Refactor `CrateLoader` into the `CStore` Removes the `CrateLoader` and moves the code to `CStore`. Now, if you want to use the `CrateLoader`, you can just use `CStore`. Should we rename `creader.rs` to `cstore.rs`? r? ``@petrochenkov``
2025-07-18Rollup merge of #144050 - JonathanBrouwer:cross-crate-reexport, r=jdonszelmannMatthias Krüger-4/+38
Fix encoding of link_section and no_mangle cross crate Fixes https://github.com/rust-lang/rust/issues/144004 ``@bjorn3`` suggested using the `codegen_fn_attrs` query but given that these attributes are not that common it's probably fine to just always encode them. I can also go for that solution if it is preferred but that would require more changes. r? ``@jdonszelmann`` ``@fmease`` (whoever feels like it)
2025-07-18Rollup merge of #143961 - 1c3t3a:correct-exploit-mitigations, r=rcvalleMatthias Krüger-11/+11
Correct which exploit mitigations are enabled by default This was brought up by ``@Noratrieb`` in [#project-exploit-mitigations > Incorrect table in the rustc book](https://rust-lang.zulipchat.com/#narrow/channel/343119-project-exploit-mitigations/topic/Incorrect.20table.20in.20the.20rustc.20book/with/523684203). Thanks! :) [Rendered](https://github.com/rust-lang/rust/blob/132a47e72316b60e99c3e5fefb9c3a06641138e4/src/doc/rustc/src/exploit-mitigations.md) r? ``@rcvalle``
2025-07-18Rollup merge of #143928 - ognevny:opt-dist-build-llvm, r=KobzolMatthias Krüger-56/+87
opt-dist: make llvm builds optional adds command line option for disabling llvm builds. it's useful in case of user having their own optimized LLVM, so they won't waste time for (at least) 3 LLVM builds. in this case PGO optimized rustc will be already built in Stage 1, so rust-lang/rust#143898 should be addressed for this change couldn't test locally on Linux laptop due to small SSD storage, will try now with windows-msvc host r? ``@Kobzol`` try-job: dist-x86_64-linux try-job: dist-x86_64-msvc
2025-07-18Rollup merge of #143382 - fee1-dead-contrib:push-trrymlzqmmoz, r=jhprattMatthias Krüger-1/+2
stabilize `const_slice_reverse` cc rust-lang/rust#135120, needs FCP.
2025-07-18Rollup merge of #142693 - fmease:unbound-bettering, r=compiler-errorsMatthias Krüger-819/+772
More robustly deal with relaxed bounds and improve their diagnostics Scaffolding for https://github.com/rust-lang/rust/issues/135229 (CC https://github.com/rust-lang/rust/pull/135331) Fixes https://github.com/rust-lang/rust/issues/136944 (6th commit). Fixes https://github.com/rust-lang/rust/issues/142718 (8th commit).
2025-07-18Rollup merge of #142673 - oli-obk:uninit-read-mem, r=RalfJungMatthias Krüger-144/+402
Show the offset, length and memory of uninit read errors r? ``@RalfJung`` I want to improve memory dumps in general. Not sure yet how to do so best within rust diagnostics, but in a perfect world I could generate a dummy in-memory file (that contains the rendered memory dump) that we then can then provide regular rustc `Span`s to. So we'd basically report normal diagnostics for them with squiggly lines and everything.
2025-07-18Rollup merge of #138554 - xizheyin:issue-138401, r=chenyukangMatthias Krüger-70/+74
Distinguish delim kind to decide whether to emit unexpected closing delimiter Fixes #138401
2025-07-19Add test demonstrating current beta `#[align]` name resolution regressionJieyou Xu-0/+43
See RUST-143834.
2025-07-18tests: Skip supported-crate-types test on musl hostsJens Reidel-0/+5
This test depends on the target-specific behavior of crt-static for musl targets. However, running the testsuite on a musl host requires setting `crt-static` to `false`, as it wouldn't otherwise be possible to build rustc. This in turn will enable `-Ctarget-feature=-crt-static` for all tests, mismatching the expected `+crt-static` for the musl target tested in this testcase. Since this test specifically tests the default value of `crt-static` for the musl target, ignoring it entirely makes more sense than manually setting `-Ctarget-feature=+crt-static` here, but both would be valid approaches. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18tests: Add a regression test for crt-static with target featuresJens Reidel-0/+32
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18rustc_codegen_ssa: Don't skip target-features after crt-staticJens Reidel-2/+2
The current behaviour introduced by commit a50a3b8e318594c41783294e440d864763e412ef would discard any target features specified after crt-static (the only member of RUSTC_SPECIFIC_FEATURES). This is because it returned instead of continuing processing the next flag. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18Add implicit sized bound to trait ascription typesMichael Goulet-0/+38
2025-07-18fix: don't panic on volatile access to nullLuigi Sartor Piucco-138/+127
According to https://discourse.llvm.org/t/rfc-volatile-access-to-non-dereferenceable-memory-may-be-well-defined/86303/4, LLVM allows volatile operations on null and handles it correctly. This should be allowed in Rust as well, because I/O memory may be hard-coded to address 0 in some cases, like the AVR chip ATtiny1626. A test case that ensured a failure when passing null to volatile was removed, since it's now valid. Due to the addition of `maybe_is_aligned` to `ub_checks`, `maybe_is_aligned_and_not_null` was refactored to use it. docs: revise restrictions on volatile operations A distinction between usage on Rust memory vs. non-Rust memory was introduced. Documentation was reworded to explain what that means, and make explicit that: - No trapping can occur from volatile operations; - On Rust memory, all safety rules must be respected; - On Rust memory, the primary difference from regular access is that volatile always involves a memory dereference; - On Rust memory, the only data affected by an operation is the one pointed to in the argument(s) of the function; - On Rust memory, provenance follows the same rules as non-volatile access; - On non-Rust memory, any address known to not contain Rust memory is valid (including 0 and usize::MAX); - On non-Rust memory, no Rust memory may be affected (it is implicit that any other non-Rust memory may be affected, though, even if not referenced by the pointer). This should be relevant when, for example, reading register A causes a flag to change in register B, or writing to A causes B to change in some way. Everything affected mustn't be inside an allocation. - On non-Rust memory, provenance is irrelevant and a pointer with none can be used in a valid way. fix: don't lint null as UB for volatile Also remove a now-unneeded `allow` line. fix: additional wording nits
2025-07-18Be a bit more careful around exotic cycles in in the inlinerMichael Goulet-16/+242
2025-07-18Merge commit 'f682d09eefc6700b9e5851ef193847959acf4fac' into ↵Guillaume Gomez-625/+85
subtree-update_cg_gcc_2025-07-18
2025-07-18Merge commit 'f682d09eefc6700b9e5851ef193847959acf4fac' into ↵Guillaume Gomez-625/+85
subtree-update_cg_gcc_2025-07-18
2025-07-18Auto merge of #143845 - cjgillot:stability-query, r=jieyouxubors-926/+767
Split-up stability_index query This PR aims to move deprecation and stability processing away from the monolithic `stability_index` query, and directly implement `lookup_{deprecation,stability,body_stability,const_stability}` queries. The basic idea is to: - move per-attribute sanity checks into `check_attr.rs`; - move attribute compatibility checks into the `MissingStabilityAnnotations` visitor; - progressively dismantle the `Annotator` visitor and the `stability_index` query. The first commit contains functional change, and now warns when `#[automatically_derived]` is applied on a non-trait impl block. The other commits should not change visible behaviour. Perf in https://github.com/rust-lang/rust/pull/143845#issuecomment-3066308630 shows small but consistent improvement, except for unused-warnings case. That case being a stress test, I'm leaning towards accepting the regression. This PR changes `check_attr`, so has a high conflict rate on that file. This should not cause issues for review.
2025-07-18Merge pull request #735 from rust-lang/sync_from_rust_2025_07_04antoyo-622/+68
Sync from rust 2025/07/04
2025-07-18Comment some tests in the m68k CI because we cannot run programs on ↵Antoni Boucher-16/+22
architectures not supported by the object crate anymore
2025-07-18unicode-table-gen: more clippy fixesMarijn Schouten-8/+8
2025-07-18Fix `empty_with_brackets` span handling.Jason Newcomb-4/+8
2025-07-18unicode-table-gen: edition 2024Marijn Schouten-2/+2
2025-07-18unicode-table-gen: clippy fixesMarijn Schouten-35/+28
2025-07-18Auto merge of #144130 - matthiaskrgr:rollup-t75stad, r=matthiaskrgrbors-155/+427
Rollup of 11 pull requests Successful merges: - rust-lang/rust#143280 (Remove duplicate error about raw underscore lifetime) - rust-lang/rust#143649 (Add test for `default_field_values` and `const_default`) - rust-lang/rust#143699 (Make `AsyncDrop` check that it's being implemented on a local ADT) - rust-lang/rust#143908 (`tests/ui`: A New Order [0/28] ) - rust-lang/rust#143909 (docs(alloc::fmt): Make type optional, instead of matching empty string) - rust-lang/rust#143925 (Make slice comparisons const) - rust-lang/rust#143997 (Use $crate in macros for rustc_public (aka stable_mir)) - rust-lang/rust#144013 (resolve: Make disambiguators for underscore bindings module-local) - rust-lang/rust#144029 (Fix wrong messages from methods with the same name from different traits) - rust-lang/rust#144063 (Add myself to the `infra-ci` reviewer group and adjust some infra auto-labels) - rust-lang/rust#144069 (ci: use windows 22 for all free runners) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-18Merge pull request #1874 from heiher/loong-safeFolkert de Vries-2933/+2940
loongarch: Mark partial intrinsics as safe
2025-07-18Generalize `unsize` and `unsize_into` destinationsOli Scherer-4/+5
2025-07-18Rollup merge of #144069 - marcoieni:windows-22-free, r=jieyouxuMatthias Krüger-2/+4
ci: use windows 22 for all free runners try-job: `x86_64-msvc-*`
2025-07-18Rollup merge of #144063 - jieyouxu:label-ci, r=KobzolMatthias Krüger-0/+8
Add myself to the `infra-ci` reviewer group and adjust some infra auto-labels - Commit 1 is a drive-by adjustment. Auto-label `src/ci` and `.github/workflows` with https://github.com/rust-lang/rust/labels/A-CI, and include `.github/workflows` for https://github.com/rust-lang/rust/labels/T-infra trigger files. - Commit 2 adds myself to the `infra-ci` reviewer adhoc group. r? ``````@Kobzol``````
2025-07-18Rollup merge of #144029 - lichuang:fix_issue_143740, r=compiler-errorsMatthias Krüger-28/+70
Fix wrong messages from methods with the same name from different traits fix issue https://github.com/rust-lang/rust/issues/143740
2025-07-18Rollup merge of #144013 - petrochenkov:disambunder, r=oli-obkMatthias Krüger-45/+58
resolve: Make disambiguators for underscore bindings module-local Disambiguators attached to underscore name bindings (like `const _: u8 = something;`) do not need to be globally unique, they just need to be unique inside the module in which they live, because the bindings in a module are basically kept as `Map<BindingKey, SomeData>`. Also, the specific values of the disambiguators are not important, so a glob import of `const _` may have a different disambiguator than the original `const _` itself. So in this PR the disambiguator is just set to the current number of bindings in the module. This removes one more piece of global mutable state from resolver and unblocks https://github.com/rust-lang/rust/pull/143884.
2025-07-18Rollup merge of #143997 - Coder-256:stable-mir-macro-hygiene, r=oli-obkMatthias Krüger-9/+9
Use $crate in macros for rustc_public (aka stable_mir) This makes `#[macro_use] extern crate rustc_public` unnecessary (which brings all of `rustc_public`'s macros into scope for the entire crate); instead, now you can simply use `rustc_public::run!()`.
2025-07-18Rollup merge of #143925 - oli-obk:slice-const-partialeq, r=fee1-deadMatthias Krüger-49/+134
Make slice comparisons const This needed a fix for `derive_const`, too, as it wasn't usable in libcore anymore as trait impls need const stability attributes. I think we can't use the same system as normal trait impls while `const_trait_impl` is still unstable. r? ```@fee1-dead``` cc rust-lang/rust#143800
2025-07-18Rollup merge of #143909 - nik-rev:patch-1, r=jhprattMatthias Krüger-2/+2
docs(alloc::fmt): Make type optional, instead of matching empty string Think this is clearer. Noticed as I was implementing [`tree-sitter-rust-format-args`](https://github.com/nik-rev/tree-sitter-rust-format-args), and attempting to match the empty string results in an error.
2025-07-18Rollup merge of #143908 - Kivooeo:tf0, r=jieyouxuMatthias Krüger-16/+22
`tests/ui`: A New Order [0/28] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. These are the some last tests that didn’t make it into the main twenty-eightology of PRs. Part of rust-lang/rust#133895. r? ```@jieyouxu```
2025-07-18Rollup merge of #143699 - compiler-errors:async-drop-fund, r=oli-obkMatthias Krüger-3/+53
Make `AsyncDrop` check that it's being implemented on a local ADT Fixes https://github.com/rust-lang/rust/issues/143691
2025-07-18Rollup merge of #143649 - estebank:const-trait-default-field-value, r=oli-obkMatthias Krüger-0/+37
Add test for `default_field_values` and `const_default` Add a test showing `#![feature(default_field_values)]` using `#[const_trait] trait Default` (`#![feature(const_default)]` + `#![feature(const_trait_impl)]`). CC https://github.com/rust-lang/rust/issues/132162
2025-07-18Rollup merge of #143280 - xizheyin:143152-1, r=compiler-errorsMatthias Krüger-1/+30
Remove duplicate error about raw underscore lifetime Fixes rust-lang/rust#143152 r? ```@fee1-dead```
2025-07-18loongarch: Mark SIMD intrinsics without memory access as safeWANG Rui-2891/+2901
2025-07-18Deduplicate `unmatched_delims` in `rustc_parse` to reduce confusionxizheyin-84/+62
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-18Merge pull request #4476 from RalfJung/page-protRalf Jung-93/+84
move page protection logic inside native_lib