about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-01-30Rollup merge of #136251 - hkBst:opt_imports, r=estebankMatthias Krüger-10/+5
use impl Into<String> instead of explicit type args with bounds
2025-01-30Rollup merge of #136199 - purplesyringa:emscripten-tests, r=jieyouxuMatthias Krüger-10/+41
Fix a couple Emscripten tests This fixes a couple Emscripten tests where the correct fix is more or less obvious. A couple UI tests are still broken with this PR: - `tests/ui/abi/numbers-arithmetic/return-float.rs` (#136197) - `tests/ui/no_std/no-std-unwind-binary.rs` (haven't debugged yet) - `tests/ui/test-attrs/test-passed.rs` (haven't debugged this either) `````@rustbot````` label +T-compiler +O-emscripten
2025-01-30Rollup merge of #136179 - oli-obk:push-vxvyttorquxw, r=BoxyUwUMatthias Krüger-0/+56
Allow transmuting generic pattern types to and from their base Pattern types always have the same size as their base type, so we can just ignore the pattern and look at the base type for figuring out whether transmuting is possible.
2025-01-30Rollup merge of #135882 - hkBst:master, r=estebankMatthias Krüger-22/+18
simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]` All uses immediately invoke contains, so maybe a further simplification is possible.
2025-01-30Rollup merge of #135739 - wesleywiser:dwarf_version_handling, r=lqdMatthias Krüger-27/+38
Clean up uses of the unstable `dwarf_version` option - Consolidate calculation of the effective value. - Check the target `DebuginfoKind` instead of using `is_like_msvc`. - Add the tracking issue to the unstable book page for this feature. cc #103057
2025-01-30Rollup merge of #135434 - dianne:match-2024-for-edition-2024, r=NadrierilMatthias Krüger-336/+1923
Match Ergonomics 2024: update edition 2024 behavior of feature gates This updates the edition 2024 behavior of the feature gates `ref_pat_eat_one_layer_2024_structural` and `ref_pat_eat_one_layer_2024` to correspond to the left and right typing rules compared [here](https://nadrieril.github.io/typing-rust-patterns/?compare=true&opts2=AQEBAAABAQABAgIAAQEBAAEBAAABAAA%3D&opts1=AQEBAgEBAQEBAgIAAAAAAAAAAAAAAAA%3D&mode=rules&do_cmp=true&ty_d=3&style=SequentBindingMode), respectively. I'll implement the proposed new behavior for editions ≤ 2021 in another PR. The tests are split up a bit awkwardly for practical reasons, but I've added new tests from 3 places: - I got tests for where the typing rules differ from the "Compare" tab of the page linked above. These had to be split up based on where the errors are emitted and how rustfixable they are, so they've ended up in different files to keep tidy. Within each file, though, the order of the tests matches the order the typing differences appear in that comparison (as of when this was written). - I used [this other comparison](https://nadrieril.github.io/typing-rust-patterns/?q=%5B%26mut+%26%28mut+x%29%5D%3A+%26mut+%5B%26CT%5D&compare=true&opts2=AQEBAgABAQEBAgIAAQEBAAEBAAABAAA%3D&opts1=AQEBAgEBAQEBAgIAAAAAAAAAAAAAAAA%3D&mode=compare&do_cmp=true&ty_d=3&style=SequentBindingMode) to test the `Deref(EatInner, FallbackToOuter)` rule of the left/"structural"/eat-inner ruleset. These are all in `well-typed-edition-2024.rs`. - I added some select tests for cases where the new typing rules differ from current stable Rust. I had to be pickier about what I included here, but I tried to make sure each typing rule got some coverage. That said, my approach for these tests was a bit ad-hoc, so I may have missed something. Relevant tracking issue: #123076 r? ````@ghost````
2025-01-30Rollup merge of #133636 - GuillaumeGomez:sans-serif, r=rustdocMatthias Krüger-11/+117
[rustdoc] Add sans-serif font setting Fixes https://github.com/rust-lang/rust/issues/52449. This PR adds a new setting introducing the possibility to switch to a sans-serif font (`Fira Sans`) for the text. Can be tested [here](https://rustdoc.crud.net/imperio/sans-serif/std/index.html). cc ```@rust-lang/rustdoc-frontend``` r? ```@notriddle```
2025-01-30Auto merge of #136272 - Zalathar:rollup-6s577l5, r=Zalatharbors-227/+296
Rollup of 5 pull requests Successful merges: - #135847 (optimize slice::ptr_rotate for small rotates) - #136215 (btree/node.rs: remove incorrect comment from pop_internal_level docs) - #136252 (spastorino back from vacations) - #136254 (Rustc dev guide subtree update) - #136259 (Cleanup docs for Allocator) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-29Add tracking issue to docsWesley Wiser-0/+4
2025-01-29Clean up uses of the unstable `dwarf_version` optionWesley Wiser-27/+34
- Consolidate calculation of the effective value. - Check the target `DebuginfoKind` instead of using `is_like_msvc`.
2025-01-30Rollup merge of #136259 - hkBst:patch-30, r=thomccStuart Cook-31/+27
Cleanup docs for Allocator This is an attempt to remove ungrammatical constructions and clean up the prose. I've sometimes had to try hard to understand what was being stated, so it is possible that I've misunderstood the original meaning. In particular, I did not see a difference between: - the borrow-checker lifetime of the allocator type itself. - as long as at least one of the allocator instance and all of its clones has not been dropped.
2025-01-30Rollup merge of #136254 - BoxyUwU:rdg-push, r=KobzolStuart Cook-41/+55
Rustc dev guide subtree update r? `@Kobzol`
2025-01-30Rollup merge of #136252 - spastorino:remove-spastorino-on-vacations, r=jieyouxuStuart Cook-1/+0
spastorino back from vacations
2025-01-30Rollup merge of #136215 - btj:patch-1, r=cuviperStuart Cook-2/+2
btree/node.rs: remove incorrect comment from pop_internal_level docs
2025-01-30Rollup merge of #135847 - edwloef:slice_ptr_rotate_opt, r=scottmcmStuart Cook-152/+212
optimize slice::ptr_rotate for small rotates r? `@scottmcm` This swaps the positions and numberings of algorithms 1 and 2 in `slice::ptr_rotate`, and pulls the entire outer loop into algorithm 3 since it was redundant for the first two. Effectively, `ptr_rotate` now always does the `memcpy`+`memmove`+`memcpy` sequence if the shifts fit into the stack buffer. With this change, an `IndexMap`-style `move_index` function is optimized correctly. Assembly comparisons: - `move_index`, before: https://godbolt.org/z/Kr616KnYM - `move_index`, after: https://godbolt.org/z/1aoov6j8h - the code from `#89714`, before: https://godbolt.org/z/Y4zaPxEG6 - the code from `#89714`, after: https://godbolt.org/z/1dPx83axc related to #89714 some relevant discussion in https://internals.rust-lang.org/t/idea-shift-move-to-efficiently-move-elements-in-a-vec/22184 Behavior tests pass locally. I can't get any consistent microbenchmark results on my machine, but the assembly diffs look promising.
2025-01-30Auto merge of #136035 - SpecificProtagonist:miri-zeroed-alloc, r=oli-obkbors-79/+88
miri: optimize zeroed alloc When allocating zero-initialized memory in MIR interpretation, rustc allocates zeroed memory, marks it as initialized and then re-zeroes it. Remove the last step. I don't expect this to have much of an effect on performance normally, but in my case in which I'm creating a large allocation via mmap it gets in the way.
2025-01-29Auto merge of #135818 - jieyouxu:migrate-translation, r=compiler-errorsbors-81/+208
tests: Port `translation` to rmake.rs Part of #121876. This PR partially supersedes #129011 and is co-authored with `@Oneirical.` ## Summary This PR ports `tests/run-make/translation` to rmake.rs. Notable changes from the Makefile version include: - We now actually fail if the rustc invocations fail... The Makefile did not have `SHELL=/bin/bash -o pipefail`, so all the piped rustc invocations to grep vacuously succeeded, even if the broken ftl test case actually regressed over time and ICEs on current master. - That test case is converted to assert it fails with a FIXME backlinking to #135817. - The test coverage is expanded to not ignore windows. Instead, the test now uses symlink capability detection to gate test execution. - Added some backlinks to relevant tracking issues and the initial translation infra implementation PR. ## Review advice Best reviewed commit-by-commit. r? compiler try-job: aarch64-apple try-job: i686-mingw
2025-01-29Auto merge of #134248 - oli-obk:patkind-path-removal, r=BoxyUwUbors-183/+299
Merge `PatKind::Path` into `PatKind::Expr` Follow-up to #134228 We always had a duplication where `Path`s could be represented as `PatKind::Path` or `PatKind::Lit(ExprKind::Path)`. We had to handle both everywhere, and still do after #134228, so I'm removing it now.
2025-01-29Cleanup docs for AllocatorMarijn Schouten-31/+27
2025-01-29add inline attribute and codegen testedwloef-0/+34
2025-01-29split slice::ptr_rotate into three separate algorithms, to hopefully help ↵edwloef-174/+195
inlining
2025-01-29Rustc pullBoxy-16876/+29059
2025-01-29spastorino back from vacationsSantiago Pastorino-1/+0
2025-01-29Auto merge of #136248 - matthiaskrgr:rollup-leaxgfd, r=matthiaskrgrbors-206/+321
Rollup of 8 pull requests Successful merges: - #133382 (Suggest considering casting fn item as fn pointer in more cases) - #136092 (Test pipes also when not running on Windows and Linux simultaneously) - #136190 (Remove duplicated code in RISC-V asm bad-reg test) - #136192 (ci: remove unused windows runner) - #136205 (Properly check that array length is valid type during built-in unsizing in index) - #136211 (Update mdbook to 0.4.44) - #136212 (Tweak `&mut self` suggestion span) - #136214 (Make crate AST mutation accessible for driver callback) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-29Handle all `PatExpr`s in dead code analysisOli Scherer-23/+15
2025-01-29Add regression test showing we don't realize some consts are usedOli Scherer-8/+33
2025-01-29Eliminate PatKind::PathOli Scherer-174/+273
2025-01-29Rollup merge of #136214 - momvart:driver_callback_crate_mut, r=bjorn3Matthias Krüger-5/+5
Make crate AST mutation accessible for driver callback Following #134130, this brings back the ability to mutate AST before lowering.
2025-01-29Rollup merge of #136212 - estebank:span-tweak, r=petrochenkovMatthias Krüger-26/+21
Tweak `&mut self` suggestion span ``` error[E0596]: cannot borrow `*self.s` as mutable, as it is behind a `&` reference --> $DIR/issue-38147-1.rs:17:9 | LL | self.s.push('x'); | ^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable | help: consider changing this to be a mutable reference | LL | fn f(&mut self) { | +++ ``` Note the suggestion to add `mut` instead of replacing the entire `&self` with `&mut self`.
2025-01-29Rollup merge of #136211 - ehuss:update-mdbook, r=ehussMatthias Krüger-27/+27
Update mdbook to 0.4.44 Updates to mdbook 0.4.44. Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0444
2025-01-29Rollup merge of #136205 - compiler-errors:len-3, r=BoxyUwUMatthias Krüger-9/+63
Properly check that array length is valid type during built-in unsizing in index This results in duplicated errors, but this class of errors is not new; in general, we aren't really equipped to detect cases where a WF error due to a field type would be shadowed by the parent struct of that field also not being WF. This also adds a note for these types of mismatches to make it clear that this is due to an array type. Fixes #134352 r? boxyuwu
2025-01-29Rollup merge of #136192 - marcoieni:remove-windows-unused-runner, r=KobzolMatthias Krüger-4/+0
ci: remove unused windows runner
2025-01-29Rollup merge of #136190 - taiki-e:dedup, r=compiler-errorsMatthias Krüger-128/+90
Remove duplicated code in RISC-V asm bad-reg test I added this test in https://github.com/rust-lang/rust/pull/132516, but I accidentally repeated the same check twice. https://github.com/rust-lang/rust/blob/aa6f5ab18e67cb815f73e0d53d217bc54b0da924/tests/ui/asm/riscv/bad-reg.rs#L39-L42
2025-01-29Rollup merge of #136092 - tbu-:pr_io_pipe_test, r=joboetMatthias Krüger-1/+1
Test pipes also when not running on Windows and Linux simultaneously Fixes https://github.com/rust-lang/rust/pull/135635#pullrequestreview-2574184488. Based on top of #135635 to avoid merge conflicts.
2025-01-29Rollup merge of #133382 - mu001999-contrib:diag/fnitem, r=lcnrMatthias Krüger-6/+114
Suggest considering casting fn item as fn pointer in more cases Fixes #132648
2025-01-29Auto merge of #136227 - fmease:rollup-ewpvznh, r=fmeasebors-755/+1812
Rollup of 9 pull requests Successful merges: - #136121 (Deduplicate operand creation between scalars, non-scalars and string patterns) - #136134 (Fix SIMD codegen tests on LLVM 20) - #136153 (Locate asan-odr-win with other sanitizer tests) - #136161 (rustdoc: add nobuild typescript checking to our JS) - #136166 (interpret: is_alloc_live: check global allocs last) - #136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items) - #136170 (Reject unsound toggling of Arm atomics-32 target feature) - #136176 (Render pattern types nicely in mir dumps) - #136186 (uefi: process: Fix args) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-29Add SemiBold for SourceSerif4Guillaume Gomez-3/+13
2025-01-29Allow transmuting generic pattern types to and from their baseOli Scherer-23/+6
2025-01-29Add tests for transmuting pattern typesOli Scherer-0/+73
2025-01-29Add italic for newly added sans serif fontsGuillaume Gomez-6/+26
2025-01-29Fix tidy errorsGuillaume Gomez-2/+4
2025-01-29Fix tidy errorsGuillaume Gomez-2/+4
2025-01-29Add GUI test for new "sans serif fonts" settingGuillaume Gomez-4/+35
2025-01-29Add new setting allowing to switch to sans serif fontsGuillaume Gomez-2/+43
2025-01-29use impl Into<String>Marijn Schouten-10/+5
2025-01-29Auto merge of #136117 - lnicola:sync-from-ra, r=lnicolabors-1325/+2163
Subtree update of `rust-analyzer` r? `@ghost`
2025-01-29tests: port `translation` to rmake.rs许杰友 Jieyou Xu (Joe)-79/+194
Co-authored-by: Oneirical <manchot@videotron.ca>
2025-01-29run-make-support: improve docs for `assert_exit_code`许杰友 Jieyou Xu (Joe)-1/+5
2025-01-29run-make-support: add `sysroot` helper许杰友 Jieyou Xu (Joe)-1/+9
Convenience helper for `rustc --print=sysroot`.
2025-01-29btree/node.rs: pop_internal_level: does not invalidate other handlesBart Jacobs-0/+3