| Age | Commit message (Collapse) | Author | Lines |
|
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
|
|
Rollup of 7 pull requests
Successful merges:
- #134367 (Stabilize `feature(trait_upcasting)`)
- #135940 (Update toolstate maintainers)
- #135945 (Remove some unnecessary parens in `assert!` conditions)
- #136577 (Pattern Migration 2024: try to suggest eliding redundant binding modifiers)
- #136598 (Fix suggestion for `dependency_on_unit_never_type_fallback` involving closures + format args expansions)
- #136653 (Remove dead code from rustc_codegen_llvm and the LLVM wrapper)
- #136664 (replace one `.map_or(true, ...)` with `.is_none_or(...)`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
replace one `.map_or(true, ...)` with `.is_none_or(...)`
Randomly found while going through some of my old branches.
|
|
Remove dead code from rustc_codegen_llvm and the LLVM wrapper
First step to clean up the LLVM wrapper: remove existing dead code.
Split out of #135502
r? ``@Zalathar``
|
|
Fix suggestion for `dependency_on_unit_never_type_fallback` involving closures + format args expansions
fixes #136562
r? wafflelapkin or reassign
|
|
r=Nadrieril
Pattern Migration 2024: try to suggest eliding redundant binding modifiers
This is based on #136475. Only the last commit is new.
This is a simpler, more restrictive alternative to #136496, meant to partially address #136047. If a pattern can be migrated to Rust 2024 solely by removing redundant binding modifiers, this will make that suggestion; otherwise, it uses the old suggestion of making the pattern fully explicit.
Relevant tracking issue: #131414
``@rustbot`` label A-diagnostics A-patterns A-edition-2024
r? ``@Nadrieril``
|
|
Remove some unnecessary parens in `assert!` conditions
While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter.
|
|
Update toolstate maintainers
This updates the toolstate maintainers to more closely match who is still active.
|
|
r=compiler-errors
Stabilize `feature(trait_upcasting)`
This feature was "done" for a while now, I think it's finally time to stabilize it! Stabilization report: https://github.com/rust-lang/rust/pull/134367#issuecomment-2545839841.
cc reference PR: https://github.com/rust-lang/reference/pull/1622.
Closes #65991 (tracking issue), closes #89460 (the lint is no longer future incompat).
r? compiler-errors
|
|
Rollup of 8 pull requests
Successful merges:
- #135973 (fix tail call checks wrt `#[track_caller]`)
- #136191 (compiler: replace few consts arrays with statics to remove const dupes)
- #136565 (compiler: Clean up weird `rustc_abi` reexports)
- #136582 (Revert "CI: build FreeBSD artifacts on FreeBSD 13.4")
- #136627 (MIR validation: add comment explaining the limitations of CfgChecker)
- #136634 (Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.)
- #136643 (ping me for attribute-related changes)
- #136644 (Add `rustc_hir_pretty::item_to_string` function)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add `rustc_hir_pretty::item_to_string` function
Another one needed for rustdoc. :)
r? `@Urgau`
|
|
ping me for attribute-related changes
r? `@fmease`
|
|
Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.
Closes: #130801
This PR stabilises the `const_mut_cursor` feature gate.
|
|
MIR validation: add comment explaining the limitations of CfgChecker
I hope this right but I am not sure.^^
Cc `@compiler-errors` `@lcnr` `@cjgillot` `@oli-obk`
|
|
Revert "CI: build FreeBSD artifacts on FreeBSD 13.4"
This reverts commit cf34545720986d99712e3b542e8f395360c75095.
That commit led to a regression of
https://github.com/rust-lang/rust/issues/132185 . So my analysis that the problem lay in FreeBSD 13.2's specific LLVM version was clearly wrong. Revert that commit until we can figure out the real root cause.
Fixes #132185
try-job: dist-x86_64-freebsd
try-job: dist-various-2
|
|
compiler: Clean up weird `rustc_abi` reexports
Just general cleanup in `rustc_target` and `rustc_abi`. I was originally going to make a PR with a larger change that also fixed the last few crates and in doing so removed some clutter from `rustc_abi`, but wound up slightly stuck on it, then figured out how to fix it, and then got distracted by other things... so now I'm trying to figure out what I had figured out earlier.
|
|
compiler: replace few consts arrays with statics to remove const dupes
Locally on `x86_64-pc-windows-msvc` -100kb for `rustc_driver.dll`
|
|
fix tail call checks wrt `#[track_caller]`
Only check the caller + disallow caller having the attribute.
fixes #134336
r? `@compiler-errors`
<sub>apparently there were no tests for `#[track_caller]` before... ooops</sub>
|
|
ci: use ubuntu 22 for free arm runners
try-job: aarch64-gnu
try-job: aarch64-gnu-debug
|
|
Don't reset cast kind without also updating the operand in `simplify_cast` in GVN
Consider this heavily elided segment of the pre-GVN example code that was committed as a test:
```rust
let _4: *const ();
let _5: *const [()];
let mut _6: *const ();
let _7: *mut ();
let mut _8: *const [()];
let mut _9: std::boxed::Box<()>;
let mut _10: *const ();
/* ... */
// Deref a box
_10 = copy ((_9.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>) as *const () (Transmute);
_4 = copy _10;
_6 = copy _4;
// Inlined body of `slice::from_raw_parts`, to turn a unit pointer into a slice-of-unit pointer
_5 = *const [()] from (copy _6, copy _11);
_8 = copy _5;
// Cast the raw slice-of-unit pointer back to a unit pointer
_7 = copy _8 as *mut () (PtrToPtr);
```
A malformed optimization was changing `_7` (which casted the slice-of-unit ptr to a unit ptr) to:
```
_7 = copy _5 as *mut () (Transmute);
```
...where `_8` was just replaced with `_5` bc of simple copy propagation, that part is not important... the CastKind changing to Transmute is the important part here.
In #133324, two new functionalities were implemented:
* Peeking through unsized -> sized PtrToPtr casts whose operand is `AggregateKind::RawPtr`, to turn it into PtrToPtr casts of the base of the aggregate. In this case, this allows us to see that the value of `_7` is just a ptr-to-ptr cast of `_6`.
* Folding a PtrToPtr cast of an operand which is a Transmute cast into just a single Transmute, which (theoretically) allows us to treat `_7` as a transmute into `*mut ()` of the base of the cast of `_10`, which is the place projection of `((_9.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>)`.
However, when applying those two subsequent optimizations, we must *not* update the CastKind of the final cast *unless* we also update the operand of the cast, since the operand may no longer make sense with the updated CastKind.
In this case, this is problematic because the type of `_8` is `*const [()]`, but that operand in assignment statement of `_7` does *not* get turned into something like `((_9.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>)` -- **in other words, `try_to_operand` fails** -- because GVN only turns value nodes into locals or consts, not projections of locals. So we fail to update the operand, but we still update the CastKind to Transmute, which means we now are transmuting types of different sizes (a wide pointer and a thin pointer).
r? `@scottmcm` or `@cjgillot`
Fixes #136361
Fixes #135997
|
|
Rollup of 7 pull requests
Successful merges:
- #133925 (disallow `repr()` on invalid items)
- #136069 (Simplify slice indexing in next trait solver)
- #136152 (Stabilize `map_many_mut` feature)
- #136219 (Misc. `rustc_hir` cleanups 🧹)
- #136580 (Couple of changes to run rustc in miri)
- #136636 (Couple of minor cleanups to the diagnostic infrastructure)
- #136645 (Clippy subtree update)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
this commit makes `deref_into_dyn_supertrait` lint allow-by-default,
removes future incompatibility (we finally live in a broken world), and
changes the wording in the documentation.
previously documentation erroneously said that it lints against *usage*
of the deref impl, while it actually (since 104742) lints on the impl
itself (oooops, my oversight, should have updated it 2+ years ago...)
|
|
We can't remove `TraitUpcasting` variant, since we need to use the index
in winnowing.
|
|
|
|
|
|
|
|
|
|
(so that it doesn't talk about trait upcasting stabilization in the
future tense)
|
|
|
|
While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter.
|
|
|
|
Clippy subtree update
r? `@Manishearth`
|
|
Couple of minor cleanups to the diagnostic infrastructure
|
|
Couple of changes to run rustc in miri
This is not the full set of patches required to run rustc in miri, but it is the fast majority of the changes to rustc itself. There is also a change to the jobserver crate necessary and on arm64 a change to the memchr crate. Running rustc in miri has already found some UB: https://github.com/rust-lang/rust/pull/136579
cc https://github.com/rust-lang/rust/issues/135870#issuecomment-2612470540
|
|
Misc. `rustc_hir` cleanups 🧹
Each commit stands on its own, but I think all of them make the code a bit cleaner
|
|
Stabilize `map_many_mut` feature
This PR stabilize `HashMap::get_many_mut` as `HashMap::get_disjoint_mut` and `HashMap::get_many_unchecked_mut` as `HashMap::get_disjoint_unchecked_mut` per FCP.
FCP at https://github.com/rust-lang/rust/issues/97601#issuecomment-2532710423
Fixes #97601
r? libs
|
|
Simplify slice indexing in next trait solver
Unless I'm missing something:
- no need to explicitly specify the end of the slice as the end of the index range
- the `assert` is redundant since the indexing will panic for the same condition
I think this change simplifies it a bit. Also replaced the `for` loop of `push`es with a call to `extend` with an iterator. Might improve performance since it knows how many elements will be added beforehand and can pre-reserve room?
r? `@compiler-errors` , I think
|
|
disallow `repr()` on invalid items
fixes https://github.com/rust-lang/rust/issues/129606
fixes https://github.com/rust-lang/rust/issues/132391
Disallows `repr()` (so a repr with no arguments) on items where that won't ever make sense.
Also this generates an error when `repr` is used on a trait method and the `fn_align` feature is not enabled. Looks like that was missed here:
https://github.com/rust-lang/rust/pull/110313/files
Which first accepts the align attribute on trait methods.
r? `@compiler-errors`
cc `@jdonszelmann` who claimed https://github.com/rust-lang/rust/issues/132391 and generally has been working on attributes
|
|
only check the caller + disallow caller having the attr.
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #136073 (Always compute coroutine layout for eagerly emitting recursive layout errors)
- #136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern)
- #136311 (Ensure that we never try to monomorphize the upcasting or vtable calls of impossible dyn types)
- #136315 (Use short ty string for binop and unop errors)
- #136393 (Fix accidentally not emitting overflowing literals lints anymore in patterns)
- #136435 (Simplify some code for lowering THIR patterns)
- #136630 (Change two std process tests to not output to std{out,err}, and fix test suite stat reset in bootstrap CI test rendering)
r? `@ghost`
`@rustbot` modify labels: rollup
try-job: aarch64-gnu-debug
|
|
|
|
implement `eat_until` leveraging memchr in lexer
|
|
clippy-subtree-update
|
|
r? @ghost
changelog: none
|