about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-09-04Rollup merge of #145963 - heiher:src-analysis-lsx, r=lqdStuart Cook-3/+107
Add LSX accelerated implementation for source file analysis This patch introduces an LSX-optimized version of `analyze_source_file` for the `loongarch64` target. Similar to existing SSE2 implementation for x86, this version: - Processes 16-byte chunks at a time using LSX vector intrinsics. - Quickly identifies newlines in ASCII-only chunks. - Falls back to the generic implementation when multi-byte UTF-8 characters are detected or in the tail portion.
2025-09-04Rollup merge of #145962 - bjorn3:linkage_fixes, r=WaffleLapkinStuart Cook-39/+98
Ensure we emit an allocator shim when only some crate types need one Found this while trying to write a test for https://github.com/rust-lang/rust/pull/145955.
2025-09-04Rollup merge of #145932 - JamieCunliffe:target-feature-inlining, r=jackh726Stuart Cook-27/+400
Allow `inline(always)` with a target feature behind a unstable feature `target_feature_inline_always`. Rather than adding the inline always attribute to the function definition, we add it to the callsite. We can then check that the target features match and that the call would be safe to inline. If the function isn't inlined due to a mismatch, we emit a warning informing the user that the function can't be inlined due to the target feature mismatch. See tracking issue rust-lang/rust#145574
2025-09-04Rollup merge of #145827 - estebank:issue-51976, r=jackh726Stuart Cook-84/+912
On unused binding or binding not present in all patterns, suggest potential typo of unit struct/variant or const When encountering an or-pattern with a binding not available in all patterns, look for consts and unit struct/variants that have similar names as the binding to detect typos. ``` error[E0408]: variable `Ban` is not bound in all patterns --> $DIR/binding-typo.rs:22:9 | LL | (Foo, _) | (Ban, Foo) => {} | ^^^^^^^^ --- variable not in all patterns | | | pattern doesn't bind `Ban` | help: you might have meant to use the similarly named unit variant `Bar` | LL - (Foo, _) | (Ban, Foo) => {} LL + (Foo, _) | (Bar, Foo) => {} | ``` For items that are not in the immedate scope, suggest the full path for them: ``` error[E0408]: variable `Non` is not bound in all patterns --> $DIR/binding-typo-2.rs:51:16 | LL | (Non | Some(_))=> {} | --- ^^^^^^^ pattern doesn't bind `Non` | | | variable not in all patterns | help: you might have meant to use the similarly named unit variant `None` | LL - (Non | Some(_))=> {} LL + (core::option::Option::None | Some(_))=> {} | ``` When encountering a typo in a pattern that gets interpreted as an unused binding, look for unit struct/variant of the same type as the binding: ``` error: unused variable: `Non` --> $DIR/binding-typo-2.rs:36:9 | LL | Non => {} | ^^^ | help: if this is intentional, prefix it with an underscore | LL | _Non => {} | + help: you might have meant to pattern match on the similarly named variant `None` | LL - Non => {} LL + std::prelude::v1::None => {} | ``` Suggest constant on unused binding in a pattern ``` error: unused variable: `Batery` --> $DIR/binding-typo-2.rs:110:9 | LL | Batery => {} | ^^^^^^ | help: if this is intentional, prefix it with an underscore | LL | _Batery => {} | + help: you might have meant to pattern match on the similarly named constant `Battery` | LL | Battery => {} | + ``` Fix rust-lang/rust#51976.
2025-09-04Rollup merge of #145750 - btj:drop-alloc-guard, r=tgross35Stuart Cook-25/+2
raw_vec.rs: Remove superfluous fn alloc_guard `alloc_guard` checks that its argument is at most `isize::MAX`, but it is called only with layout sizes, which are already guaranteed to be at most `isize::MAX`.
2025-09-04Rollup merge of #145342 - dianne:if-let-super-let, r=nnethercoteStuart Cook-41/+155
fix drop scope for `super let` bindings within `if let` Fixes rust-lang/rust#145328 by making non-lifetime-extended `super let` reuse the logic used to compute drop scopes for non-lifetime-extended temporaries. Also fixes rust-lang/rust#145374, which regressed due to rust-lang/rust#143376 introducing `if let`-like scopes for match arms with guards. Tracking issue for `super let`: rust-lang/rust#139076 This is a regression fix / breaking change for macros stably exposing `super let`, including `pin!` and `format_args!`. Nominating to be discussed alongside rust-lang/rust#145328: ```@rustbot``` label +I-lang-nominated +I-libs-api-nominated
2025-09-04Rollup merge of #145209 - hanna-kruppe:path_add_extension, r=tgross35Stuart Cook-7/+3
Stabilize `path_add_extension` FCP in tracking issue rust-lang/rust#127292 finished in January. There was more discussion since then, but [libs-api decided to match `set_extension`][0] by keeping the return type as-is and adding a panic for invalid extensions. The latter was implemented in rust-lang/rust#140163, so this feature should be ready for stabilization. But if anyone's unsure, another FCP could be done to confirm. Closes rust-lang/rust#127292 [0]: https://github.com/rust-lang/rust/issues/127292#issuecomment-2605197960
2025-09-04Rollup merge of #143725 - kennytm:peekable_next_if_map, r=jhprattStuart Cook-0/+189
core: add Peekable::next_if_map Implementation for rust-lang/rust#143702
2025-09-04Rollup merge of #140459 - niklasf:feature/read-buf-at, r=tgross35Stuart Cook-23/+307
Add `read_buf` equivalents for positioned reads Adds the following items under the ~~`read_buf` (rust-lang/rust#78485)~~ `read_buf_at` (rust-lang/rust#140771) feature: - `std::os::unix::fs::FileExt::read_buf_at` - `std::os::unix::fs::FileExt::read_buf_exact_at` - `std::os::windows::fs::FileExt::seek_read_buf` try-job: `x86_64-msvc*` try-job: `test-various*` try-job: `dist-various*`
2025-09-03In the rustc_llvm build script, don't consider arm64* to be 32-bitDaniel Paoliello-1/+4
2025-09-03Auto merge of #146156 - RalfJung:miri, r=RalfJungbors-632/+1665
miri subtree update Subtree update of `miri` to https://github.com/rust-lang/miri/commit/883dbf03e2a82ed7922122d8c2c2c60a5844b90d. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2025-09-04Don't require next-solver `ProbeRef` to be `Copy`Chayim Refael Friedman-8/+9
rust-analyzer would like to use a non-interned `Probe` there. Also rename it to `Probe` for this reason.
2025-09-04fix: `read_zero_byte_vec` suggests wrongly inside `let` stmtyanglsh-10/+109
2025-09-03Fix some broken linksEmmet Horgan-9/+9
Signed-off-by: Emmet Horgan <horgan098@gmail.com>
2025-09-03support keyword-based mentions in tidyRalf Jung-1/+6
2025-09-03triagebot: configure some pings when certain attributes are usedRalf Jung-0/+15
2025-09-03fix applying an error to infinitiesRalf Jung-0/+8
2025-09-03Auto merge of #146133 - rcvalle:rust-cfi-fix-145981, r=bjorn3bors-23/+12
Revert "Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins` This reverts commit cf8753e4f9c3597f04cd5d3aa261e4561d5378a6 (PR https://github.com/rust-lang/rust/pull/145368) and fix the regressions reported at rust-lang/rust#145981, rust-lang/rust#146109, and rust-lang/rust#146145.
2025-09-03Add `read_buf` equivalents for positioned readsNiklas Fiekas-23/+308
Adds the following items under the `read_buf_at` feature: - `std::os::unix::fs::FileExt::read_buf_at` - `std::os::unix::fs::FileExt::read_buf_exact_at` - `std::os::windows::fs::FileExt::seek_read_buf`
2025-09-04fix: offline rustdoc html missing faviconKumar Ujjawal-2/+29
2025-09-03Reduce bootstrap's dependenciesDaniel Paoliello-34/+108
2025-09-03simplify `check_c_variadic_type`Folkert de Vries-94/+111
2025-09-03test valid cases of c-variadic function definitionsFolkert de Vries-0/+29
2025-09-03htmldocck: fix a bug in relative paths / globsMichael Howell-1/+1
This bug only shows up when you run htmldocck in a directory other than outdir, and also use globs. Never happened before, which is why we're only seeing it now.
2025-09-03rustdoc-search: add test case for indexing every item typeMichael Howell-0/+170
Test case for 7b35d8e1ab2d913f4b15d0ee21d5bd8d50798e9c and ad2e0961366a6bf5e01d6863a459424e78ebcf40
2025-09-03std: improve the `dlsym!` macro and add a test for itjoboet-51/+102
* Ensure nul-termination of the symbol name at compile-time * Use an acquire load instead of a relaxed load and acquire fence * Properly use `unsafe` and add safety comments * Add tests
2025-09-03Uncomment code to add scraped rustdoc examples in loaded pathsGuillaume Gomez-6/+4
2025-09-03Auto merge of #146160 - Zalathar:rollup-qxphx7g, r=Zalatharbors-371/+776
Rollup of 8 pull requests Successful merges: - rust-lang/rust#145279 (Constify conversion traits (part 1)) - rust-lang/rust#145414 (unicode-table-generator refactors) - rust-lang/rust#145823 (editorconfig: don't use nonexistent syntax) - rust-lang/rust#145944 (std: Start supporting WASIp2 natively ) - rust-lang/rust#145961 (resolve: Avoid a regression from splitting prelude into two scopes) - rust-lang/rust#146032 (Explicity disable LSX feature for `loongarch64-unknown-none` target) - rust-lang/rust#146106 (fix(lexer): Only allow horizontal whitespace in frontmatter ) - rust-lang/rust#146154 (CI: rfl: move job forward to Linux v6.17-rc3 plus 2 commits) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-03Check `rustc-dev` in `distcheck`Jakub Beránek-18/+50
2025-09-03Merge pull request #4506 from Patrick-6/miri-genmc-mvpRalf Jung-481/+3667
Add minimal functionality for using GenMC mode
2025-09-03don't uppercase error messagesSasha Pourcelot-248/+248
a more general version of https://github.com/rust-lang/rust/pull/146080. after a bit of hacking in [`fluent.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_fluent_macro/src/fluent.rs), i discovered that i'm not the only one that is bad at following guidelines :sweat_smile:. this pr lowercases the first letter of all the error messages in the codebase. (i did not change things that are traditionally uppercased such as _MIR_, _ABI_ or _C_) i think it's reasonable to run a `@bors try` so all the test suite is checked, as i cannot run some of the tests on my machine. i double checked (and replaced manually) all the old error messages, but better be safe than sorry. in the future i will try to add a check in `x test tidy` that errors if an error message starts with an uppercase letter.
2025-09-03Merge pull request #1911 from nikic/remove-hackFolkert de Vries-12/+4
Remove some llvm workarounds
2025-09-03Add applicable on bang `!` for apply_demorganA4-Tacks-7/+28
Example --- ```rust fn f() { $0!(1 || 3 && 4 || 5) } ``` -> ```rust fn f() { !1 && !(3 && 4) && !5 } ```
2025-09-03Rollup merge of #146154 - ojeda:rfl, r=lqdStuart Cook-1/+2
CI: rfl: move job forward to Linux v6.17-rc3 plus 2 commits This upgrades the Rust CI from v6.16-rc1 plus a temporary commit for the >= 1.91 target spec [1] to v6.17-rc3 with two commits pending to be merged upstream -- one for the same target spec format change [1] and another for the `file_as_c_str` change [2]. Link: https://github.com/rust-lang/rust/pull/144443 [1] Link: https://github.com/rust-lang/rust/pull/145928 [2] r? ``@lqd`` ``@Kobzol`` try-job: x86_64-rust-for-linux ``@rustbot`` label A-rust-for-linux ``@bors`` try
2025-09-03Rollup merge of #146106 - epage:whitespace, r=fee1-deadStuart Cook-21/+73
fix(lexer): Only allow horizontal whitespace in frontmatter In writing up the reference for frontmatter, I realized that we probably shouldn't be accepting Unicode Line Ending characters between the code fence and infostring or trailing after the infostring or a code fence. In digging into the unicode specification we use for Whitespace, it divides it up into categories, so I'm deferring to what it says for horizontal whitespace for what should be used within a line. Note, I am leaving out support for Unicode Default Ignorable characters. I figure that can be discussed outside of this change within the reference and tracking issue. Fixes rust-lang/rust#145971 Frontmatter tracking issue: rust-lang/rust#136889
2025-09-03Rollup merge of #146032 - heiher:loong64-none-no-lsx, r=lqdStuart Cook-1/+1
Explicity disable LSX feature for `loongarch64-unknown-none` target The `loongarch64-unknown-none` target is a bare-metal target with hardware floating-point support and should not enable SIMD extensions by default. However, LLVM's LoongArch64 backend enables LSX implicitly, inadvertently activating SIMD instructions for this target. This patch explicitly disable LSX feature to prevent unintended SIMD usage.
2025-09-03Rollup merge of #145961 - petrochenkov:extprelregr, r=nnethercoteStuart Cook-3/+33
resolve: Avoid a regression from splitting prelude into two scopes Fixes https://github.com/rust-lang/rust/issues/145575.
2025-09-03Rollup merge of #145944 - alexcrichton:native-wasip2, r=tgross35Stuart Cook-16/+222
std: Start supporting WASIp2 natively This commit is the start of an effort to support WASIp2 natively in the standard library. Before this commit the `wasm32-wasip2` target behaved exactly like `wasm32-wasip1` target by importing APIs from the core wasm module `wasi_snapshot_preview1`. These APIs are satisfied by the `wasm-component-ld` target by using an [adapter] which implements WASIp1 in terms of WASIp2. This adapter comes at a cost, however, in terms of runtime indirection and instantiation cost, so ideally the adapter would be removed entirely. The purpose of this adapter was to provide a smoother on-ramp from WASIp1 to WASIp2 when it was originally created. The `wasm32-wasip2` target has been around for long enough now that it's much more established. Additionally the only thing historically blocking using WASIp2 directly was implementation effort. Work is now underway to migrate wasi-libc itself to using WASIp2 directly and now seems as good a time as any to migrate the Rust standard library too. Implementation-wise the milestones here are: * The `wasm32-wasip2` target now also depends on the `wasi` crate at version 0.14.* in addition to the preexisting dependency of 0.11.*. The 0.14.* release series binds WASIp2 APIs instead of WASIp1 APIs. * Some preexisting naming around `mod wasi` or `wasi.rs` was renamed to `wasip1` where appropriate. For example `std::sys::pal::wasi` is now called `std::sys::pal::wasip1`. * More platform-specific WASI modules are now split between WASIp1 and WASIp2. For example getting the current time, randomness, and process arguments now use WASIp2 APIs directly instead of using WASIp1 APIs that require an adapter. It's worth pointing out that this PR does not migrate the entire standard library away from using WASIp1 APIs on the `wasm32-wasip2` target. Everything related to file descriptors and filesystem APIs is still using WASIp1. Migrating that is left for a future PR. In the meantime the goal of this change is to lay the groundwork necessary for migrating in the future. Eventually the goal is to drop the `wasi` 0.11.* dependency on the `wasm32-wasip2` target (the `wasm32-wasip1` target will continue to retain this dependency). [adapter]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-preview1-component-adapter/README.md
2025-09-03Rollup merge of #145823 - lolbinarycat:editorconfig-fix, r=GuillaumeGomezStuart Cook-5/+8
editorconfig: don't use nonexistent syntax reading through the editorconfig spec, using `!` to negate an entire glob is simply not a feature. you can use `!` to negate a charachter class, but that's not what was going on here.
2025-09-03Rollup merge of #145414 - Kmeakin:km/unicode-table-refactors, ↵Stuart Cook-153/+159
r=joshtriplett,tgross35 unicode-table-generator refactors Split off from https://github.com/rust-lang/rust/pull/145219
2025-09-03Rollup merge of #145279 - clarfonthey:const-convert-initial, r=tgross35Stuart Cook-171/+278
Constify conversion traits (part 1) This is the first part of rust-lang/rust#144289 being split into smaller pieces. It adds/moves constness of several traits under the `const_convert` feature: * `From` * `Into` * `TryFrom` * `TryInto` * `FromStr` * `AsRef` * `AsMut` * `Borrow` * `BorrowMut` * `Deref` * `DerefMut` There are a few methods that are intrinsically tied to these traits which I've included in the feature. Particularly, those which are wrappers over `AsRef`: * `ByteStr::new` (unstable under `bstr` feature) * `OsStr::new` * `Path::new` Those which directly use `Into`: * `Result::into_ok` * `Result::into_err` And those which use `Deref` and `DerefMut`: * `Pin::as_ref` * `Pin::as_mut` * `Pin::as_deref_mut` * `Option::as_deref` * `Option::as_deref_mut` * `Result::as_deref` * `Result::as_deref_mut` (note: the `Option` and `Result` methods were suggested by ``@npmccallum`` initially as rust-lang/rust#146101) The parts which are missing from this PR are: * Anything that involves heap-allocated types * Making any method const than the ones listed above * Anything that could rely on the above, *or* could rely on system-specific code for `OsStr` or `Path` (note: this mostly makes these methods useless since `str` doesn't implement `AsRef<OsStr>` yet, but it's better to track the method for now and add impls later, IMHO) r? ``@tgross35`` (who mostly already reviewed this)
2025-09-03Unify and deduplicate algebraic float testsRomain Perier-83/+44
2025-09-03remove thread option from self-test invocationbit-aloo-2/+1
2025-09-03Merge pull request #1909 from a4lg/riscv-clmul-lower-requirementsSayantan Chakraborty-2/+2
RISC-V: Lower requirements of `clmul` and `clmulh`
2025-09-03unstable book: in a sanitizer example, check the codeFolkert de Vries-16/+16
this uses some # directives to make sure the code works on x86_64, and does not produce errors on other platforms
2025-09-03Implement basic support for running Miri with GenMC.Patrick-6-429/+3572
- Implement memory allocation compatible with GenMC. - Extract address generator struct from Miri's allocator. - Support thread creation and joining. - Support atomic load and store. - Support scheduling through GenMC. - Add tests for GenMC mode. - Add clang-format file for C++ code in Miri. - Update genmc-sys crate license to MIT/Apache to match GenMC dependency. - Add documentation for GenMC mode. Note: this commit depends on changes to GenMC not yet upstreamed to its official repository. Co-authored-by: Ralf Jung <post@ralfj.de>
2025-09-03Extract address generator struct from memory allocator.Patrick-6-52/+95
2025-09-03update lockfileRalf Jung-2/+2
2025-09-03Merge pull request #4562 from RalfJung/ciRalf Jung-10/+9
re-balance CI
2025-09-03no need to run GC_STRESS more than once for each OSRalf Jung-6/+4