Commit graph

316801 commits

Author SHA1 Message Date
Sasha Pourcelot
c259c4048a compiletest: normalize stderr before SVG rendering
Element position is hardcoded in the rendered SVG. This means that any
change in element length (for instance, when substituting the path with
the `rust` checkout with `$DIR`) would not change the position and result
in buggy SVG being generated. Normalizing before SVG rendering allows us
to keep a consistent element placement.
2026-02-16 15:29:01 +00:00
bors
e823167aa6 Auto merge of #151858 - JonathanBrouwer:rollup-0eagSST, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#151736 (Make some load-from-disk function pointers optional in query vtables)
 - rust-lang/rust#151831 (Port `rustc_layout` to attribute parser)
 - rust-lang/rust#151856 (Fix flakyness issue with `tests/rustdoc-gui/globals.goml` test)
2026-01-30 12:11:07 +00:00
Jonathan Brouwer
6d01651dff
Rollup merge of #151856 - GuillaumeGomez:fix-gui-flakyness, r=GuillaumeGomez
Fix flakyness issue with `tests/rustdoc-gui/globals.goml` test

Just realized that when the search input is wrong, sometime we don't even load the search index (which is logical). Since we want to check that the search index is loaded, turned the query into something that works.

r? ghost
2026-01-30 12:12:06 +01:00
Jonathan Brouwer
e19cb30813
Rollup merge of #151831 - clubby789:port-rustc-layout, r=JonathanBrouwer
Port `rustc_layout` to attribute parser

Tracking issue: rust-lang/rust#131229

Uses rust-lang/rust#151827

r? jdonszelmann
2026-01-30 12:12:05 +01:00
Jonathan Brouwer
cc2d6f8fee
Rollup merge of #151736 - Zalathar:can-load-from-disk, r=nnethercote
Make some load-from-disk function pointers optional in query vtables

For queries that never incremental-cache to disk, we can represent that fact with None (i.e. a null function pointer) in their vtables, and avoid having to generate stub functions that do nothing.

(There is no decrease in vtable size; we just go from 3/8 padding bytes to 4/8 padding bytes.)

There should be no change to compiler output.
2026-01-30 12:12:05 +01:00
Guillaume Gomez
9e5820379d Fix flakyness issue with tests/rustdoc-gui/globals.goml test 2026-01-30 11:22:19 +01:00
Zalathar
e044220de5 Make will_cache_on_disk_for_key_fn optional in query vtables 2026-01-30 21:18:29 +11:00
Zalathar
d39609b719 Make is_loadable_from_disk_fn optional in query vtables 2026-01-30 21:16:25 +11:00
Zalathar
d5e80aa714 Make try_load_from_disk_fn optional in query vtables 2026-01-30 21:16:25 +11:00
bors
7d8ebe3128 Auto merge of #151852 - Zalathar:rollup-jdJCcDh, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151777 (    Reduce generics use in the query system.)
 - rust-lang/rust#151808 (Document a safety condition for `TypedArena::alloc_raw_slice`)
 - rust-lang/rust#151811 (Fix false positive in unused_parens caused by break)
 - rust-lang/rust#151817 (Fix missing syntax context in lifetime hygiene debug output)
 - rust-lang/rust#151844 (rustc-dev-guide subtree update)
2026-01-30 06:41:46 +00:00
Stuart Cook
5b542088ae
Rollup merge of #151844 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to e03697d813.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-01-30 17:41:08 +11:00
Stuart Cook
dcc74dd6e3
Rollup merge of #151817 - aytey:fix_lifetime_unpretty_hygiene, r=jdonszelmann
Fix missing syntax context in lifetime hygiene debug output

`-Zunpretty=expanded,hygiene` was not printing the syntax context for lifetimes. For example, two macro-generated lifetimes `'a` with different hygiene would both print as `/* 2538 */` instead of `/* 2538#0 */` and `/* 2538#1 */`, making it impossible to distinguish them.

This was fixed by changing `print_lifetime` to call `ann_post()` with the full `Ident`, matching how regular identifiers are handled in `print_ident`.

Closes: rust-lang/rust#151797
2026-01-30 17:41:07 +11:00
Stuart Cook
45009749b5
Rollup merge of #151811 - chenyukang:yukang-fix-143256-unused-parens-labeled-loops, r=Kivooeo
Fix false positive in unused_parens caused by break

Fixes rust-lang/rust#143256
2026-01-30 17:41:07 +11:00
Stuart Cook
611ebade75
Rollup merge of #151808 - Zalathar:alloc-raw-slice, r=Kivooeo
Document a safety condition for `TypedArena::alloc_raw_slice`

This method was marked safe in https://github.com/rust-lang/rust/pull/116224/commits/51edc219906f0973dd66b4b6ff5ff0ac857a4cc6, because there was no apparent reason for it to be unsafe.

However, I believe that `alloc_raw_slice` does actually impose a significant safety obligation on its caller, because the caller must ensure that each slot in the slice is properly initialized before the arena is dropped.

This is because the arena's Drop impl will unconditionally drop every storage slot that has been handed out, so it has no way to handle slots that were accidentally left uninitialized because a hypothetical caller of `alloc_raw_slice` panicked before initializing them.
2026-01-30 17:41:06 +11:00
Stuart Cook
0af845db6b
Rollup merge of #151777 - nnethercote:query-stack-3, r=nnethercote
Reduce generics use in the query system.

In rust-lang/rust#151203 I tried and failed to simplify `QueryStackFrame`. This is an alternative approach. There is no functional change, just tweaking of some names and types to make things clearer. Best reviewed one commit at a time.

r? @oli-obk
2026-01-30 17:41:06 +11:00
bors
ef2657cbaf Auto merge of #151168 - petrochenkov:rprivtit, r=eholk
privacy: Fix privacy lints in RPITITs

Visit RPITITs and report `private_interfaces`, `private_bounds` and `exported_private_dependencies` in them (these are regular, non-deprecation lints).
New hard errors are not reported, https://github.com/rust-lang/rust/pull/146470 is for hard errors.
So this PR doesn't contain any breakage or language changes.
2026-01-30 01:45:52 +00:00
Nicholas Nethercote
1c3d9abbad Reduce generics use in the query system.
`QueryStackFrame<I>` is a generic type, and the `I` parameter leaks out
to many other related types. However, it only has two instantiations in
practice:
- `QueryStackFrame<QueryStackFrameExtra>`
- `QueryStackFrame<QueryStackDeferred<'tcx>>`

And most of the places that currently use `QueryStackFrame<I>` are
actually specific to one of the instantiations. This commit removes the
unneeded genericity.

The following types are only ever used with `QueryStackDeferred<'tcx>`:
- QueryMap
- QueryJobInfo
- QueryJob
- QueryWaiter
- QueryLatchInfo
- QueryLatch
- QueryState
- QueryResult
and their `<I>` parameter is changed to `<'tcx>`.

Also, the `QueryContext::QueryInfo` associated type is removed.

`CycleError<I>` and `QueryInfo<I>` are still generic over type, because
they are used with both instantiations.

This required also adding a `<'tcx>` parameter to the traits
`QueryDispatcher` and `QueryContext`, which is annoying but I can't see
how to avoid it.
2026-01-30 10:54:28 +11:00
Tshepang Mbambo
6ea1809c5e
Merge pull request #2748 from rust-lang/tshepang/sembr
sembr
2026-01-30 01:05:28 +02:00
Tshepang Mbambo
62dbe9fbab whitespace 2026-01-30 00:59:05 +02:00
Tshepang Mbambo
31eab45e4a fix sembr tool corner case 2026-01-30 00:58:42 +02:00
Nicholas Nethercote
637e2cb5e1 Rename create_query_frame_extra.
It produces a `QueryStackFrameExtra`, so `stack_` should be in the name.
2026-01-30 09:56:41 +11:00
Nicholas Nethercote
654945a736 Simplify QueryStackFrame::new.
Instead of passing a closure that computes a hash and immediately
calling it, just compute the hash and pass the value.
2026-01-30 09:56:41 +11:00
Tshepang Mbambo
c3e9f0007e sembr src/rustdoc-internals/rustdoc-json-test-suite.md 2026-01-30 00:31:17 +02:00
Tshepang Mbambo
84e994ebd4 sembr src/tests/ci.md 2026-01-30 00:28:12 +02:00
Tshepang Mbambo
b4ded124a7 extraneous whitespace 2026-01-30 00:27:42 +02:00
Tshepang Mbambo
654a5a3404 sembr src/compiler-team.md 2026-01-30 00:24:39 +02:00
Jamie Hill-Daniel
72338fafb2 Port rustc_layout to attribute parser 2026-01-29 22:23:58 +00:00
Tshepang Mbambo
d34695f503 some improvements 2026-01-30 00:21:42 +02:00
Tshepang Mbambo
d7e88cf39b sembr src/git.md 2026-01-30 00:08:23 +02:00
Tshepang Mbambo
ffc3b8a3f1 capitalise start of sentence 2026-01-30 00:03:23 +02:00
Tshepang Mbambo
2aea912db2 sembr src/building/suggested.md 2026-01-29 23:51:07 +02:00
Tshepang Mbambo
d4764e3210 some improvements 2026-01-29 23:46:27 +02:00
bors
35a31ba763 Auto merge of #140283 - adwinwhite:fn-pointer-coercion, r=jackh726
Fix accidental type inference in array coercion


Fixes rust-lang/rust#136420.

If the expectation of array element is a type variable, we should avoid resolving it to the first element's type and wait until LUB coercion is completed.
We create a free type variable instead which is only used in this `CoerceMany`.

[`check_expr_match`](847e3ee6b0/compiler/rustc_hir_typeck/src/_match.rs (L72)) and [`check_expr_if`](847e3ee6b0/compiler/rustc_hir_typeck/src/expr.rs (L1329)) where `CoerceMany` is also used do the [same](847e3ee6b0/compiler/rustc_hir_typeck/src/expectation.rs (L50)). 

### [FCP Proposal](https://github.com/rust-lang/rust/pull/140283#issuecomment-2933771068):
> Array expressions normally lub their element expressions' types to ensure that things like `[5, 5_u8]` work and don't result in type mismatches. When invoking a generic function `fn foo<T>(_: [T; N])` with an array expression, we end up with an infer var for the element type of the array in the signature. So when typecking the first array element we compare its type with the infer var and thus subsequently require all other elements to be the same type.
> 
> This PR changes that to instead fall back to "not knowing" that the argument type is array of infer var, but just having an infer var for the entire argument. Thus we typeck the array expression normally, lubbing the element expressions, and then in the end comparing the array expression's type with the array of infer var type.
> 
> Things like
> 
> ```rust
> fn foo() {}
> fn bar() {} 
> fn f<T>(_: [T; 2]) {}
> 
> f([foo, bar]);
> ```
> 
> and
> 
> ```rust
> struct Foo;
> struct Bar;
> trait Trait {}
> impl Trait for Foo {}
> impl Trait for Bar {} 
> fn f<T>(_: [T; 2]) {}
> 
> f([&Foo, &Bar as &dyn Trait]);
> ```

### Remaining inconsistency with `if` and `match`(rust-lang/rust#145048):
The typeck of array always uses the element coercion target type as the expectation of element exprs while `if` and `match` use `NoExpectation` if the expected type is an infer var.
This causes that array doesn't support nested coercion. 
```rust
fn foo() {}
fn bar() {}
fn main() {
    let _ =  [foo, if false { bar } else { foo }]; // type mismatch when trying to coerce `bar` into `foo` in if-then branch coercion.
}
```
But we can't simply change this behavior to be the same as `if` and `match` since [many code](https://github.com/rust-lang/rust/pull/140283#issuecomment-3190564399) depends on using the first element's type as expectation.
2026-01-29 21:36:31 +00:00
Tshepang Mbambo
7d8b5324eb sembr src/debuginfo/lldb-visualizers.md 2026-01-29 23:27:41 +02:00
Tshepang Mbambo
43fc5a40ee sembr src/walkthrough.md 2026-01-29 23:14:55 +02:00
Tshepang Mbambo
dd4870d0cc fix sembr tool corner case 2026-01-29 23:13:39 +02:00
Tshepang Mbambo
dd8ae230c7 some improvements 2026-01-29 23:08:29 +02:00
Tshepang Mbambo
03b8ebb91c sembr src/tests/ui.md 2026-01-29 22:09:02 +02:00
Tshepang Mbambo
93049c3488 fix sembr tool corner case 2026-01-29 22:06:56 +02:00
Tshepang Mbambo
b643676267 misc improvements 2026-01-29 21:57:55 +02:00
Tshepang Mbambo
83eae6253a sembr src/tests/compiletest.md 2026-01-29 21:15:07 +02:00
Tshepang Mbambo
c4718ea1d9 missing pause 2026-01-29 21:08:37 +02:00
Tshepang Mbambo
481d49de09 missing word 2026-01-29 21:08:19 +02:00
Tshepang Mbambo
b128539624 sembr src/tracing.md 2026-01-29 20:57:08 +02:00
Tshepang Mbambo
74b96acf75
Merge pull request #2747 from rust-lang/rustc-pull
Rustc pull update
2026-01-29 20:54:37 +02:00
The rustc-josh-sync Cronjob Bot
8f9dd9e570 Merge ref '370143facf' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@370143facf
Filtered ref: rust-lang/rustc-dev-guide@e706cc1e62
Upstream diff: 0462e8f7e5...370143facf

This merge was created using https://github.com/rust-lang/josh-sync.
2026-01-29 18:52:57 +00:00
The rustc-josh-sync Cronjob Bot
f0bb4e649f Prepare for merging from rust-lang/rust
This updates the rust-version file to 370143facf.
2026-01-29 18:52:52 +00:00
Tshepang Mbambo
6910e978b9
Merge pull request #2746 from rust-lang/fix-redirects
fix redirects
2026-01-29 20:44:33 +02:00
Tshepang Mbambo
c943cd9b8c fix redirects 2026-01-29 20:43:03 +02:00
bors
842bd5be25 Auto merge of #151835 - JonathanBrouwer:rollup-ayQY8NW, r=JonathanBrouwer
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#147387 (hir_owner_parent optimized to inlined call for non-incremental build)
 - rust-lang/rust#150271 (Move struct placeholder pt2)
 - rust-lang/rust#151283 (Suggest ignore returning value inside macro for unused_must_use lint)
 - rust-lang/rust#151565 (Rename, clarify, and document code for "erasing" query values)
 - rust-lang/rust#149482 (thread::scope: document how join interacts with TLS destructors)
 - rust-lang/rust#151827 (Use `Rustc` prefix for `rustc` attrs in `AttributeKind`)
 - rust-lang/rust#151833 (Treat unions as 'data types' in attr parsing diagnostics)
 - rust-lang/rust#151834 (Update `askama` version to `0.15.4`)
2026-01-29 16:48:31 +00:00