Commit graph

308340 commits

Author SHA1 Message Date
Nia Espera
7c419e8623
native-lib: bump libffi 2025-10-15 13:22:05 +02:00
apiraino
de67ea37a7
Update t-compiler beta nomination Zulip msg 2025-10-15 12:47:03 +02:00
bors
4f08307f6e Auto merge of #147619 - nnethercote:union-ne-check, r=Zalathar
Add a `!=` check to `ChunkedBitSet::union`.

It's a big speed win for `cranelift-codegen-0.119.0`.

r? `@Zalathar`
2025-10-15 10:04:49 +00:00
David Wood
519d6cd364
core: relax supertrait of Destruct 2025-10-15 09:40:44 +01:00
David Wood
676d9cfa8b
trait_sel: prefer only nested alias bounds 2025-10-15 09:35:05 +01:00
David Wood
c50aebba78
trait_sel: don't require predicates of aliases hold
No longer require that we prove that the predicates of aliases hold when
checking the well-formedness of the alias. This permits more uses of GATs
and changes the output of yet more tests.
2025-10-15 09:35:05 +01:00
David Wood
321a47eb2c
trait_sel: sizedness goals prefer alias candidates
For sizedness, default and auto trait predicates, now prefer non-param
candidates if any exist. As these traits do not have generic parameters,
it never makes sense to prefer an non-alias candidate, as there can
never be a more permissive candidate.
2025-10-15 09:35:04 +01:00
David Wood
efaeacfc96
revert: PR144016 - MetaSized does not always hold 2025-10-15 09:35:04 +01:00
Ralf Jung
a6705ea8d2
Merge pull request #4632 from RalfJung/supervisor-panic
don't debug-print an Any
2025-10-15 06:45:32 +00:00
Ralf Jung
afa2315a08
Merge pull request #4631 from rust-lang/rustup-2025-10-15
Automatic Rustup
2025-10-15 06:40:47 +00:00
zhetaicheleba
07df2adbdf Fix some comments
Signed-off-by: zhetaicheleba <taicheleba@outlook.com>
2025-10-15 14:23:28 +08:00
Ralf Jung
1819f5eece don't debug-print an Any 2025-10-15 08:16:59 +02:00
bors
5413f7d39c Auto merge of #147715 - matthiaskrgr:rollup-611b4x4, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#146841 (Stabilise `rotate_left` and `rotate_right` in `[_]` as `const fn` items.)
 - rust-lang/rust#146949 (Add vsx register support for ppc inline asm, and implement preserves_flag option)
 - rust-lang/rust#147539 (resolve: Use primitives for conditional mutability more consistently)
 - rust-lang/rust#147685 (remove span calls from deprecated attribute checking)
 - rust-lang/rust#147699 (Clairify docs for `AttributeKind::DocComment`)
 - rust-lang/rust#147706 (Add myself to review rotation)
 - rust-lang/rust#147711 (Clarify that UB will occur, not can/may in GlobalAlloc docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-15 05:45:37 +00:00
Matthias Krüger
ed6077ab18
Rollup merge of #147711 - saethlin:GlobalAlloc-safety, r=Amanieu
Clarify that UB will occur, not can/may in GlobalAlloc docs

These doc comments start out very clear by saying the caller "must" or "has to" ensure something, but the end with some form of "otherwise undefined behavior may result" which sounds like it is implementation-defined and seems to conflict with the way the paragraph starts. Consistent phrasing makes it clearer that when the safety precondition is violated, UB is encountered.

Some of the phrasing here is a bit awkward to me, I don't think we usually say "the behavior is undefined" `@RalfJung` right? But in either case I'm trying to be surgical in my edit here.

r? Amanieu
2025-10-15 07:09:57 +02:00
Matthias Krüger
6f6a1ce4d8
Rollup merge of #147706 - madsmtm:review-rotation, r=chenyukang
Add myself to review rotation

I'll try it out for a while, and see if I can keep up with things

r? compiler
2025-10-15 07:09:57 +02:00
Matthias Krüger
e389ffa763
Rollup merge of #147699 - aDotInTheVoid:doc-comment-doc-comment, r=jdonszelmann
Clairify docs for `AttributeKind::DocComment`

Makes it clear that this represents `#[doc = "content"]`, but not `#[doc(hidden)]` (or other uses of the `#[doc(...)]` attribute).

r? `@jdonszelmann`
2025-10-15 07:09:56 +02:00
Matthias Krüger
72030511bb
Rollup merge of #147685 - jdonszelmann:deprecated-no-span, r=JonathanBrouwer
remove span calls from deprecated attribute checking

r? `@JonathanBrouwer`
2025-10-15 07:09:56 +02:00
Matthias Krüger
33b1e92d4f
Rollup merge of #147539 - petrochenkov:cmresolve, r=eholk
resolve: Use primitives for conditional mutability more consistently

No bare `(Ref)Cell`s remain in `rustc_resolve`, only `Cm(Ref)Cell`s checking that nothing is modified during speculative resolution, and `Cache(Ref)Cell` aliases for cells that need to be migrated to mutexes/atomics.

cc `@LorrensP-2158466`
2025-10-15 07:09:55 +02:00
Matthias Krüger
041ecb124a
Rollup merge of #146949 - pmur:murp/improve-ppc-inline-asm, r=Amanieu
Add vsx register support for ppc inline asm, and implement preserves_flag option

This should address the last(?) missing pieces of inline asm for ppc:

* Explicit VSX register support. ISA 2.06 (POWER7) added a 64x128b register overlay extending the fpr's to 128b, and unifies them with the vmx (altivec) registers. Implementations details within gcc/llvm percolate up, and require using the `x` template modifier. I have updated the inline asm to implicitly include this for vsx arguments which do not specify it. ~~Support for the gcc codegen backend is still a todo.~~

* Implement the `preserves_flags` option. All ABI's, and all ISAs store their flags in `cr`, and the carry bit lives inside `xer`. The other status registers hold sticky bits or control bits which do not affect branch instructions.

There is some interest in the e500 (powerpcspe) port. Architecturally, it has a very different FP ISA, and includes a simd extension called SPR (which is not IBM's cell SPE). Notably, it does not have altivec/fpr/vsx registers. It also has an SPE accumulator register which its ABI marks as volatile, but I am not sure if the compiler uses it.
2025-10-15 07:09:54 +02:00
Matthias Krüger
8509756f46
Rollup merge of #146841 - bjoernager:const-slice-rotate, r=Amanieu
Stabilise `rotate_left` and `rotate_right` in `[_]` as `const fn` items.

Tracking issue: rust-lang/rust#143812

Closes: rust-lang/rust#143812

This PR stabilises the `const_slice_rotate` feature:

```rust
impl<T> [T] {
    pub const fn rotate_left(&mut self, mid: usize);

    pub const fn rotate_right(&mut self, k: usize);
}
```

No blockers or unresolved questions. FCP required.

Courtesy of `@okaneco.`
2025-10-15 07:09:54 +02:00
The Miri Cronjob Bot
a9fc0ca176 fmt 2025-10-15 05:01:36 +00:00
The Miri Cronjob Bot
bcef7d5a76 Merge ref '235a4c083e' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 235a4c083e
Filtered ref: 548dcbbeab7592100a0ba9f2338ddc8ad1003824
Upstream diff: 36e4f5d1fe...235a4c083e

This merge was created using https://github.com/rust-lang/josh-sync.
2025-10-15 05:01:01 +00:00
The Miri Cronjob Bot
75b60f17ea Prepare for merging from rust-lang/rust
This updates the rust-version file to 235a4c083e.
2025-10-15 04:53:14 +00:00
Nicholas Nethercote
60481827f6 Add a != check to ChunkedBitSet::union.
It's a big speed win for cranelift-codegen-0.119.0.
2025-10-15 13:49:38 +11:00
Nicholas Nethercote
facb9aca79 Refactor some ChunkedBitSet operations.
For less indentation, mostly.
2025-10-15 13:49:05 +11:00
Jason Newcomb
8116b2354a
Dereference argument of manual_div_ceil() if needed (#15706)
Fixes rust-lang/rust-clippy#15705

changelog: [`manual_div_ceil`]: dereference argument when needed

r? Alexendoo
2025-10-15 02:22:39 +00:00
Jason Newcomb
ec8e8fde91
refactor(non_canonical_impls): lint starting from impls (#15749)
Based on
https://github.com/rust-lang/rust-clippy/pull/15520#discussion_r2372599748,
with the following changes/additions:
- No longer use the `Trait` enum for quickly filtering out irrelevant
impls -- instead, check the `trait_of` basically right away:
    1. pre-fetch `DefId`s of the relevant traits into the lint pass
2. reuse `cx.tcx.impl_trait_ref`'s output for the the `DefId` of the
trait being implemented
    3. compare those `DefId`s, which should be very cheap
- Next, check whether `self_ty` implements the other relevant trait.
- Pre-filter impl items in the same (lazy) iterator, but delay the
proc-macro check as much as possible

changelog: none

Not auto-assigning since @blyxyas and/or @Jarcho will be the ones
reviewing it:
r? ghost
2025-10-15 02:20:21 +00:00
ltdk
491bc5008c const mem::drop 2025-10-14 21:49:24 -04:00
Jason Newcomb
d230acd9cf
Allow explicit_write in tests (#15862)
Resolves rust-lang/rust-clippy#15780.

I didn't get any feedback on that issue. So I hope it is okay that I
charged ahead and addressed it.

changelog: Allow `explicit_write` in tests
2025-10-15 01:44:50 +00:00
Ben Kimock
72396d9f18 Clarify that UB will occur, not can/may in GlobalAlloc docs 2025-10-14 21:12:11 -04:00
yukang
0935df7829 Fix ICE when using contracts on async functions 2025-10-15 09:09:23 +08:00
yukang
8182085617 Fix compiling error for redox etc 2025-10-15 08:02:32 +08:00
Alejandra González
b26a1aaa77
[unnecessary_safety_comment] Some fixes regarding comments above attributes (#15678)
The way clippy checked for SAFETY comments above attributes was wrong:
- It wasn't considered for items
- It cause an ICE with some attributes
- When considering comments above attributes, it didn't considered
comments below them, causing some unlintable situations.

This PR tries to fix this by delegating the skipping of attributes to
the function analyzing the source code itself.

changelog: [`unnecessary_safety_comment`]: Taking into account comments
above attributes for items

Fixes rust-lang/rust-clippy#14555
Fixes rust-lang/rust-clippy#15684
Fixes rust-lang/rust-clippy#15754
2025-10-14 22:18:55 +00:00
Mads Marquart
efd7c8dd61 Add myself (madsmtm) to review rotation 2025-10-15 00:13:29 +02:00
Ralf Jung
031793402a
Merge pull request #4628 from RalfJung/native-lib
native-lib: support all types with Scalar layout
2025-10-14 21:33:54 +00:00
Teodoro Freund
9cc0291582 unnecessary_safety_comment fix an ICE and
improve coverage

Considering comments above attributes for items

Fixed the ICE and safety comments between attributes

- No longer using attr.span()
- ignoring attributes manually

Improve error messages on unsafe fns
2025-10-14 22:23:53 +01:00
Ralf Jung
2feb8bba40 better error when native code tries to execute Rust function 2025-10-14 23:07:25 +02:00
bors
235a4c083e Auto merge of #147692 - matthiaskrgr:rollup-bqhlwyw, r=matthiaskrgr
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#146187 (Unstably constify `ptr::drop_in_place` and related methods)
 - rust-lang/rust#146503 (std: improve handling of timed condition variable waits on macOS)
 - rust-lang/rust#147526 (Move computation of allocator shim contents to cg_ssa)
 - rust-lang/rust#147630 (Bitset cleanups)
 - rust-lang/rust#147638 (bpf: return results larger than one register indirectly)
 - rust-lang/rust#147666 (Replace manual implementation with `carrying_mul_add`)
 - rust-lang/rust#147669 (fix missing link to `std::char` in `std` docs)
 - rust-lang/rust#147673 (pretty print u128 with display)
 - rust-lang/rust#147677 (Fewer exceptions in `span()` on parsed attributes)
 - rust-lang/rust#147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag)
 - rust-lang/rust#147682 (convert `rustc_main` to the new attribute parsing infrastructure)
 - rust-lang/rust#147683 (only check duplicates on old/unparsed attributes)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-14 20:56:53 +00:00
Ralf Jung
fe91820130 native-lib: support all types with Scalar layout 2025-10-14 22:51:50 +02:00
Jason Newcomb
eee8ef85ce
New internal lint: unusual_names (#15794)
This lint aims at detecting unusual names used in Clippy source code,
such as `appl` or `application` for a `rustc_errors::Applicability`
variable, instead of `app` and `applicability` which are commonly used
throughout Clippy.

This helps maintaining the consistency of the Clippy source code.

It is currently implemented for:

- `Applicability`: `app` or `applicability`
- `EarlyContext`/`LateContext`: `cx`
- `TyCtxt`: `tcx`

changelog: none
2025-10-14 20:32:13 +00:00
Alona Enraght-Moony
ff95799e09 Clairify docs for AttributeKind::DocComment
Makes it clear that this represents `#[doc = "content"]`, but not
`#[doc(hidden)]` (or other uses of the `#[doc(...)]` attribute).
2025-10-14 19:47:58 +00:00
Jakub Beránek
a2c7e17e2c
Do not enable LLD if we don't build host code for targets that opt into it 2025-10-14 21:09:43 +02:00
Matthias Krüger
545ee6fe6b
Rollup merge of #147683 - jdonszelmann:less-duplicate-checking, r=JonathanBrouwer
only check duplicates on old/unparsed attributes

r? ``@JonathanBrouwer``

This was effectively already what we were doing, but this was implicit because `.name()` etc were just returning None when dealing with a parsed attribute.... this makes it explicit
2025-10-14 19:47:35 +02:00
Matthias Krüger
ea0c8d8e73
Rollup merge of #147682 - jdonszelmann:convert-rustc-main, r=JonathanBrouwer
convert `rustc_main` to the new attribute parsing infrastructure

r? ``@JonathanBrouwer``
2025-10-14 19:47:34 +02:00
Matthias Krüger
3856d0b4fd
Rollup merge of #147680 - chenyukang:yukang-fix-ice-147325, r=estebank
Fix ICE caused by associated_item_def_ids on wrong type in resolve diag

Fixes rust-lang/rust#147325

r? ``@estebank``
2025-10-14 19:47:34 +02:00
Matthias Krüger
783307c4c3
Rollup merge of #147677 - jdonszelmann:fewer-span-exceptions, r=WaffleLapkin
Fewer exceptions in `span()` on parsed attributes

r? ``@JonathanBrouwer``
2025-10-14 19:47:33 +02:00
Matthias Krüger
5a2c639a23
Rollup merge of #147673 - jdonszelmann:u128-pp, r=JonathanBrouwer
pretty print u128 with display

r? ```@JonathanBrouwer```
2025-10-14 19:47:33 +02:00
Matthias Krüger
2ab43c2f91
Rollup merge of #147669 - cyrgani:cyrgani-patch-1, r=joboet
fix missing link to `std::char` in `std` docs

Missed this in rust-lang/rust#147373.
2025-10-14 19:47:32 +02:00
Matthias Krüger
49be94c392
Rollup merge of #147666 - Kivooeo:full_mud_add-followup, r=scottmcm
Replace manual implementation with `carrying_mul_add`

cc https://github.com/rust-lang/rust/pull/146277#discussion_r2427778317

r? scottmcm
2025-10-14 19:47:31 +02:00
Matthias Krüger
10e535a163
Rollup merge of #147638 - alessandrod:indirect-res, r=wesleywiser
bpf: return results larger than one register indirectly

Fixes triggering the "only small returns supported" error in the BPF target.
2025-10-14 19:47:30 +02:00