Commit Graph

48659 Commits

Author SHA1 Message Date
Oli Scherer
65aac24a08 Avoid some eager uses of HIR spans 2025-06-30 08:45:43 +00:00
Oli Scherer
5ddae353fe Stop requiring HIR for impl item wf checks 2025-06-30 08:45:43 +00:00
Oli Scherer
38ef94aef1 Stop requiring HIR for trait item wf checks 2025-06-30 08:45:43 +00:00
Oli Scherer
6166cd6b50 Avoid looking at HIR for trait and impl items 2025-06-30 08:45:43 +00:00
Oli Scherer
70215dfe61 Avoid eagerly loading the hir fn sig 2025-06-30 08:45:43 +00:00
Oli Scherer
5940109a04 Merge lower_trait_item and lower_impl_item into check_item_type 2025-06-30 08:45:43 +00:00
Oli Scherer
cb158c2119 Merge lower_item into check_item_type 2025-06-30 08:45:43 +00:00
Oli Scherer
632a921479 Move lazy type alias checks to non-hir-wfck 2025-06-30 08:45:43 +00:00
Oli Scherer
28f023c751 Use predicate spans instead of whole item spans 2025-06-30 08:45:43 +00:00
Oli Scherer
ee8fa4eb16 Check variances in the non-hir wfchecker 2025-06-30 08:45:43 +00:00
Oli Scherer
d27c05709c Make variance wfcheck only use the HIR in the error path 2025-06-30 08:45:43 +00:00
Oli Scherer
362d4ddff4 Don't look at static items' HIR for wfcheck 2025-06-30 08:45:43 +00:00
Folkert de Vries
e86fddc6d3 fix bitcast of single-element SIMD vectors 2025-06-30 10:38:35 +02:00
Oli Scherer
9b5d57d0a9 Unconditionally run check_item_type on all items 2025-06-30 08:06:08 +00:00
Oli Scherer
bd3205c02b Require either wrapping nullary intrinsincs in const blocks or explicitly deciding not to 2025-06-30 08:04:40 +00:00
Oli Scherer
d37a04d09d Remove the nullary intrinsic const eval logic and treat them like other intrinsics 2025-06-30 08:04:40 +00:00
Oli Scherer
672e0bec9e Stop backends from needing to support nullary intrinsics 2025-06-30 08:04:19 +00:00
Oli Scherer
cca072ca15 Make check_param_wf only go through the HIR in the error path 2025-06-30 08:04:11 +00:00
Oli Scherer
215009bd0c Stop storing Span that is only used for checking for global bounds that do not hold 2025-06-30 08:04:11 +00:00
Nicholas Nethercote
c3c995a275 Handle build scripts better in -Zmacro-stats output.
Currently all build scripts are listed as `build_script_build` in the
stats header. This commit uses `CARGO_PKG_NAME` to improve that.

I tried it on Bevy, it works well, giving output like this on the build
script:
```
MACRO EXPANSION STATS: serde build script
```
and this on the crate itself:
```
MACRO EXPANSION STATS: serde
```
2025-06-30 16:32:00 +10:00
Nicholas Nethercote
e0761a57ab Improve macro-stats printing.
By allowing long names to overlap with the "Uses" field when it has
spare space. This avoids unnecessary line breaks in the output.
2025-06-30 13:33:51 +10:00
bors
f19142044f Auto merge of #142941 - compiler-errors:shallow-bail, r=lcnr
Shallowly bail from `coerce_unsized` more

We do a *lot* of coercion in HIR typeck. Most of the time we're just coercing a type to itself, but we always try `coerce_unsized` even if it's not necessary.

Let's avoid doing that by adding a fast path to `coerce_unsized`; see the comment in that function.
2025-06-30 02:02:46 +00:00
bors
35f6036521 Auto merge of #142802 - compiler-errors:dedup-analyses, r=lcnr
Collapse Analysis|Borrowck|PostBorrowckAnalysis when there are no opaques

r? lcnr
2025-06-29 19:12:29 +00:00
Folkert de Vries
bcf51051ed inherit #[align] from trait method prototypes 2025-06-29 17:22:45 +02:00
Anne Stijns
54cec0cf5a Port #[link_section] to the new attribute parsing infrastructure 2025-06-29 16:23:46 +02:00
dianqk
24e553e6bc mir: Use the new method for BasicBlockData 2025-06-29 20:39:13 +08:00
dianqk
9f9cd5e283 mir: Add a new method to statement
Avoid introducing a large number of changes when adding optional initialization fields.
2025-06-29 20:13:36 +08:00
Guillaume Gomez
f9f3935fa7 Rollup merge of #143030 - Urgau:issue-143025, r=SparrowLii
Fix suggestion spans inside macros for the `unused_must_use` lint

This PR fixes the suggestion spans inside macros for the `unused_must_use` lint by trying to find the oldest ancestor span.

Fixes https://github.com/rust-lang/rust/issues/143025
2025-06-29 12:29:55 +02:00
Guillaume Gomez
66ad1f2abf Rollup merge of #142078 - sayantn:more-intrinsics, r=workingjubilee
Add SIMD funnel shift and round-to-even intrinsics

This PR adds 3 new SIMD intrinsics

 - `simd_funnel_shl` - funnel shift left
 - `simd_funnel_shr` - funnel shift right
 - `simd_round_ties_even` (vector version of `round_ties_even_fN`)

TODO (future PR): implement `simd_fsh{l,r}` in miri, cg_gcc and cg_clif (it is surprisingly hard to implement without branches, the common tricks that rotate uses doesn't work because we have 2 elements now. e.g, the `-n&31` trick used by cg_gcc to implement rotate doesn't work with this because then `fshl(a, b, 0)` will be `a | b`)

[#t-compiler > More SIMD intrinsics](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/More.20SIMD.20intrinsics/with/522130286)

`@rustbot` label T-compiler T-libs A-intrinsics F-core_intrinsics
r? `@workingjubilee`
2025-06-29 12:29:53 +02:00
bors
5ca574e85b Auto merge of #143173 - matthiaskrgr:rollup-ieu5k05, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#142021 (Doc: clarify priority of lint level sources)
 - rust-lang/rust#142367 (Add regression test for rust-lang/rust#137857 to ensure that we generate intra doc links for extern crate items.)
 - rust-lang/rust#142641 (Generate symbols.o for proc-macros too)
 - rust-lang/rust#142889 (Clarify doc comment on unix OpenOptions)
 - rust-lang/rust#143063 (explain `ImportData::imported_module`)
 - rust-lang/rust#143088 (Improve documentation of `TagEncoding`)
 - rust-lang/rust#143135 (fix typos on some doc comments)
 - rust-lang/rust#143138 (Port `#[link_name]` to the new attribute parsing infrastructure)
 - rust-lang/rust#143155 (`librustdoc` house-keeping 🧹)
 - rust-lang/rust#143169 (Remove unused feature gates)
 - rust-lang/rust#143171 (Fix the span of trait bound modifier `[const]`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-29 07:22:39 +00:00
Matthias Krüger
a262c001f6 Rollup merge of #143171 - fmease:fix-span-of-maybe-const-mod, r=compiler-errors
Fix the span of trait bound modifier `[const]`

r? project-const-traits or anyone
2025-06-29 06:59:33 +02:00
Matthias Krüger
77757e7680 Rollup merge of #143169 - yotamofek:pr/unneeded-features, r=compiler-errors
Remove unused feature gates

After finding some unused feature gates in rust-lang/rust#143155 , I wrote a small script to see if I can find any others.
And I did. Not a lot, but still a small win 😁
Contains a few instances of `iter_from_coroutine` that can be removed due to rust-lang/rust#142801 (I guess).
2025-06-29 06:59:32 +02:00
Matthias Krüger
5fc48ff5aa Rollup merge of #143138 - JonathanBrouwer:link_name_parser, r=jdonszelmann
Port `#[link_name]` to the new attribute parsing infrastructure

Ports `link_name` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197

r? `@jdonszelmann`
2025-06-29 06:59:31 +02:00
Matthias Krüger
170fd43d7d Rollup merge of #143135 - tshepang:typos, r=compiler-errors
fix typos on some doc comments
2025-06-29 06:59:31 +02:00
Matthias Krüger
6404d29442 Rollup merge of #143088 - firefighterduck:improve-doc-discr-tag, r=RalfJung
Improve documentation of `TagEncoding`

This PR is follow-up from the [discussion here](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20VariantId.3DDiscriminant.20when.20tag.20is.20niche.20encoded.3F/with/524384295).

It aims at making the `TagEncoding` documentation less ambiguous and more detailed with references to relevant implementation sides. It especially clears up the ambiguous use of discriminant/variant index, which sparked the discussion referenced above.

PS: While working with layout data, I somehow ended up looking at the docs for `FakeBorrowKind` and noticed that the one example was not in a doc comment. I hope that this is minor enough of a fix for it to be okay in this otherwise unrelated PR.
2025-06-29 06:59:30 +02:00
Matthias Krüger
fd0062cde4 Rollup merge of #143063 - bvanjoi:docs-resolve, r=petrochenkov
explain `ImportData::imported_module`

r? `@petrochenkov`
2025-06-29 06:59:30 +02:00
Matthias Krüger
e68f13c9d4 Rollup merge of #142641 - bjorn3:proc_macro_symbols_o, r=jieyouxu
Generate symbols.o for proc-macros too

To ensure used statics are functioning correctly for proc-macros too.
2025-06-29 06:59:28 +02:00
bors
dddd7ab962 Auto merge of #143161 - GuillaumeGomez:subtree-update_cg_gcc_2025-06-28, r=GuillaumeGomez
GCC backend subtree update

cc `@antoyo`

r? ghost
2025-06-29 04:18:46 +00:00
León Orell Valerian Liehr
f77fead002 Fix the span of trait bound modifier [const] 2025-06-29 04:56:28 +02:00
Yotam Ofek
8429c9911b Remove unused feature gates 2025-06-28 23:36:46 +00:00
Guillaume Gomez
3dcbc1e5bc Remove () returned value 2025-06-29 00:20:15 +02:00
Ralf Jung
75c6e14931 rename Pointer::from_addr_invalid to match strict provenance API 2025-06-29 00:16:19 +02:00
Ralf Jung
58dce8ca86 give Pointer::into_parts a more scary name and offer a safer alternative 2025-06-29 00:16:19 +02:00
bors
cf38b8e663 Auto merge of #143157 - matthiaskrgr:rollup-90rtm3a, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#123476 (std::net: adding `unix_socket_exclbind` feature for solaris/illumos.)
 - rust-lang/rust#142708 (Do not include NUL-terminator in computed length)
 - rust-lang/rust#142963 (Skip unnecessary components in x64 try builds)
 - rust-lang/rust#142987 (rustdoc: show attributes on enum variants)
 - rust-lang/rust#143031 (Add windows-gnullvm hosts to the manifest)
 - rust-lang/rust#143082 (update internal `send_signal` comment)
 - rust-lang/rust#143110 (Use tidy to sort `sym::*` items)
 - rust-lang/rust#143111 (BTreeSet: remove duplicated code by reusing `from_sorted_iter`)
 - rust-lang/rust#143114 (Minor Documentation Improvements)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: dist-i586-gnu-i586-i686-musl
2025-06-28 22:13:42 +00:00
Guillaume Gomez
a420d39afb Fix signature of filter_landing_pad 2025-06-29 00:00:58 +02:00
Guillaume Gomez
13d0ef30c9 Remove unwanted semi-colon in rustc_codegen_gcc 2025-06-28 23:50:00 +02:00
Guillaume Gomez
f8491b11f3 Merge commit 'b7091eca6d8eb0fe88b58cc9a7aec405d8de5b85' into subtree-update_cg_gcc_2025-06-28 2025-06-28 23:37:08 +02:00
Michael Goulet
1347b48584 Remove additional call to lookup_op_method 2025-06-28 20:48:58 +00:00
Michael Goulet
ed16ae851b Do not freshen ReError 2025-06-28 20:48:58 +00:00
Matthias Krüger
7103bbb86a Rollup merge of #143110 - yotamofek:pr/tidy-sort-for-symbols, r=nnethercote
Use tidy to sort `sym::*` items

Use tidy to sort the symbols in the invocation of `symbols!`, instead of implementing the ordering check inside the proc macro.

(asked `````@nnethercote````` about this on zulip, he didn't have any reservations about making this change)

This has a couple of benefits:
- tidy's "version sort" (thanks to rust-lang/rust#141311 !) is nicer than the naive-cmp sort, so, e.g. `AtomicI{8, 16, 32, 64, 128}` are properly sorted by bit width.
- consistency with the rest of the repo
- allows us to remove a bit of order-verifying code from the `symbols!` proc macro impl
2025-06-28 22:05:32 +02:00