| Age | Commit message (Collapse) | Author | Lines |
|
use impl Into<String> instead of explicit type args with bounds
|
|
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
|
|
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.
|
|
simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`
All uses immediately invoke contains, so maybe a further simplification is possible.
|
|
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
|
|
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````
|
|
[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```
|
|
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
|
|
|
|
- Consolidate calculation of the effective value.
- Check the target `DebuginfoKind` instead of using `is_like_msvc`.
|
|
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.
|
|
Rustc dev guide subtree update
r? `@Kobzol`
|
|
spastorino back from vacations
|
|
btree/node.rs: remove incorrect comment from pop_internal_level docs
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
|
|
|
|
inlining
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
Make crate AST mutation accessible for driver callback
Following #134130, this brings back the ability to mutate AST before lowering.
|
|
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`.
|
|
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
|
|
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
|
|
ci: remove unused windows runner
|
|
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
|
|
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.
|
|
Suggest considering casting fn item as fn pointer in more cases
Fixes #132648
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Subtree update of `rust-analyzer`
r? `@ghost`
|
|
Co-authored-by: Oneirical <manchot@videotron.ca>
|
|
|
|
Convenience helper for `rustc --print=sysroot`.
|
|
|