Commit Graph

286048 Commits

Author SHA1 Message Date
Josh Triplett
7103aea39a Tracking issue template: fine-grained information on style update status
Inspired by some of the communication issues around the stabilization of
`let`-chains, give more fine-grained information about the status of
updating style for any new syntax.

This does not change the process or blockers in any way; it only
*documents* the current state in the tracking issue. For instance, in
the case of `let`-chains, we would have checked the boxes for "Style
team decision" and "(non-blocking) Formatting has been implemented", and
not checked the box for the style guide. That would have then provided
better supporting information for any decisions.
2025-04-09 12:59:37 -07:00
bors
48f89e7659 Auto merge of - matthiaskrgr:rollup-d6hph16, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 -  (Try not to use verbatim paths in `Command::current_dir`)
 -  (Make `cfg_match!` a semitransparent macro)
 -  (Promise `array::from_fn` is generated in order of increasing indices)
 -  (Make the compiler suggest actual paths instead of visible paths if the visible paths are through any doc hidden path.)
 -  (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 -  (Add job summary links to post-merge report)
 -  (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-09 14:48:05 +00:00
Matthias Krüger
1aa6f70e3e
Rollup merge of - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-04-09 14:52:39 +02:00
Matthias Krüger
704d301b43
Rollup merge of - Kobzol:post-merge-links, r=marcoieni
Add job summary links to post-merge report

This should make it much easier to investigate the individual job test/duration changes.

The GitHub API handling is a bit crude, but I didn't want to include octocrab, because it more than doubles the current number of dependencies of `citool`...

Can be tested with:
```bash
$ cargo run --manifest-path src/ci/citool/Cargo.toml post-merge-report bad13a970a 1e008dd5d8
```

r? ```@marcoieni```
2025-04-09 14:52:39 +02:00
Matthias Krüger
db7e32c074
Rollup merge of - compiler-errors:has_stashed_diagnostic, r=oli-obk
Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`

More unnecessary incurred span tracking avoided by not calling `span.with_parent(None)`. This is useless on its own but makes it much easier to fix other "span tracking on the good path" issues in the future.

r? oli-obk
2025-04-09 14:52:38 +02:00
Matthias Krüger
7494bd9a4f
Rollup merge of - Kohei316:feat/doc-hidden-suggestion, r=nnethercote
Make the compiler suggest actual paths instead of visible paths if the visible paths are through any doc hidden path.

close 
Currently, when emitting a diagnostic about a valid trait, the compiler suggestes using visible paths of the trait even if they are through a doc hidden path. This PR updates the compiler to suggest actual paths in these cases.
2025-04-09 14:52:37 +02:00
Matthias Krüger
4d1a63975c
Rollup merge of - scottmcm:from_fn_docs, r=Amanieu
Promise `array::from_fn` is generated in order of increasing indices

Fixes 

I agree this needs to be documented because of the `FnMut`, either with a guarantee or to explicitly disclaim one.

I'm pretty sure this will be non-controversial (like the other "well sure you *could* do it in a different order, but why?" things were), but I couldn't find any previous libs-api decision on it so it's seemingly a new promise that will need FCP.

Basically, yes, it would be plausible to fill in the reverse order, but there's no obvious way we could ever know that that might even be a good idea, so forward seems like an easy thing to promise.  We could always add a `from_fn_rev` or something later if there's ever a strong enough need, but it seems unlikely.

Let's just do the obvious thing so it matches what `[gen(0), gen(1), …, gen(N-1)]` does.
2025-04-09 14:52:37 +02:00
Matthias Krüger
19d4d9f371
Rollup merge of - CAD97:cfg_match_semitransparent, r=dtolnay
Make `cfg_match!` a semitransparent macro

IIUC this is preferred when (potentially) stabilizing `macro` items, to avoid potentially utilizing def-site hygiene instead of mixed-site.

Tracking issue: 
2025-04-09 14:52:36 +02:00
Matthias Krüger
9e541c4673
Rollup merge of - ChrisDenton:command-curdir, r=tgross35
Try not to use verbatim paths in `Command::current_dir`

If possible, we should try not to use verbatim paths in `Command::current_dir`. It might work but it might also break code in the subprocess that assume the current directory isn't verbatim (including Windows APIs). cc ``@ehuss``

Side note: we now have a lot of ad-hoc fixes like this spread about the place. It'd be good to make a proper `WindowsPath` type that handles all this in one place. But that's a bigger job for another PR.
2025-04-09 14:52:36 +02:00
bors
f06e5c1e35 Auto merge of - cjgillot:gvn-place, r=oli-obk
Allow GVN to produce places and not just locals.

That may be too big of a hammer, as we may introduce new deref projections (possible UB footgun + probably not good for perf).

The second commit opts out of introducing projections that don't have a stable offset, which is probably what we want. Hence no new Deref and no new Index projections.

Fixes https://github.com/rust-lang/rust/issues/138936
cc `@scottmcm` `@dianqk`
2025-04-09 08:50:33 +00:00
Ralf Jung
f0fb21e93c update lockfile 2025-04-09 08:25:40 +02:00
bors
97c966bb40 Auto merge of - matthiaskrgr:rollup-b194mk8, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 -  (Restrict some queries by def-kind more)
 -  (Revert r-a changes of )
 -  (add missing word in doc comment (part 2))
 -  (Improve presentation of closure signature mismatch from `Fn` trait goal)
 -  (compiletest maintenance: sort deps and drop dep on `anyhow`)
 -  (Rustc dev guide subtree update)
 -  (Fix deprecation note for std::intrinsics)
 -  (compiletest: Remove the `--logfile` flag)
 -  (Instantiate higher-ranked transmute goal w/ placeholders before emitting sub-obligations)
 -  (Update library tracking issue template to set S-tracking-unimplemented)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-09 05:39:18 +00:00
bors
c1b8b7e86f Auto merge of - petrochenkov:errkind-ann, r=jieyouxu
UI tests: add missing diagnostic kinds where possible

The subset of https://github.com/rust-lang/rust/pull/139427 that only adds diagnostic kinds to line annotations, without changing any other things in annotations or compiletest.
After this only non-viral `NOTE`s and `HELP`s should be missing.

r? `@jieyouxu`
2025-04-09 02:19:37 +00:00
Chris Denton
edfc747225
Avoid verbatim paths in Command::current_dir
If possible, we should try not to use verbatim paths in Command::current_dir. It might work but it might also break code (including some Windows APIs) that assume the current directory isn't verbatim.
2025-04-09 01:32:19 +00:00
bors
de5b8a4c77 Auto merge of - matthiaskrgr:rollup-j6goald, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 -  (rm `RegionInferenceContext::var_infos`)
 -  (compiletest: Stricter parsing for diagnostic kinds)
 -  (Update books)
 -  (document panic behavior of Vec::resize and Vec::resize_with)
 -  (Fix stack overflow in exhaustiveness due to recursive HIR opaque hidden types)
 -  (add missing word in doc comment)
 -  (clean: remove Deref<Target=RegionKind> impl for Region and use `.kind()`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-08 22:51:10 +00:00
Vadim Petrochenkov
b3f75353a2 UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
Matthias Krüger
f2fd24df00
Rollup merge of - joshtriplett:library-tracking-issue-template, r=Amanieu
Update library tracking issue template to set S-tracking-unimplemented

This will help people notice the `S-tracking-*` labels, and if the
tracking issue *is* implemented, they can change the label.

Discussed in a `@rust-lang/libs-api` meeting.

r? `@Amanieu`
2025-04-08 21:26:03 +02:00
Matthias Krüger
8a64ba5c3f
Rollup merge of - compiler-errors:transmute, r=lcnr
Instantiate higher-ranked transmute goal w/ placeholders before emitting sub-obligations

This avoids an ICE where we weren't keeping track of bound variables correctly in the `Freeze` obligations we emit for transmute goals. We could use `rebind` instead on that goal, but I think it's better just to instantiate the binder.

Fixes 

r? `@lcnr` or reassign
2025-04-08 21:26:02 +02:00
Matthias Krüger
049d897bae
Rollup merge of - Zalathar:no-logfile, r=jieyouxu
compiletest: Remove the `--logfile` flag

This flag is deprecated in libtest (), and there's no evidence in-tree of this flag actually being passed to compiletest.

For detailed information about test results, bootstrap parses JSON output from compiletest instead ().

As part of my experimental work on removing the libtest dependency from compiletest, it's useful to be able to disconnect libtest functionality that isn't needed.
2025-04-08 21:26:02 +02:00
Matthias Krüger
51bc376737
Rollup merge of - smanilov:issue-139505, r=RalfJung
Fix deprecation note for std::intrinsics

Also checked the rest of the mentions of std::mem in the changed file and they look good to me.

Fixes 
2025-04-08 21:26:01 +02:00
Matthias Krüger
87dfd1245f
Rollup merge of - BoxyUwU:rgd-push, r=jieyouxu
Rustc dev guide subtree update

r? `@jieyouxu`
2025-04-08 21:26:00 +02:00
Matthias Krüger
40be0470b5
Rollup merge of - jieyouxu:compiletest-maintenance-1, r=lqd
compiletest maintenance: sort deps and drop dep on `anyhow`

Two changes:

1. Sort compiletest deps alphabetically because it was annoying me (harder to quickly glance what deps compiletest is using).
2. Drop dependency on `anyhow`. There's only one usage of `anyhow`, which is for `with_context` on sth that would immediately panic anyway.
2025-04-08 21:26:00 +02:00
Matthias Krüger
b41e2bd807
Rollup merge of - compiler-errors:sig-mismatch, r=lcnr
Improve presentation of closure signature mismatch from `Fn` trait goal

Flip the order of "expected" and "found" since that wasn't correct.

Don't present the arguments as a tuple, since it leaves a trailing comma. Instead, just use `fn(arg, arg)`.

Finally, be better with binders since we were just skipping binders.

r? oli-obk or reassign
2025-04-08 21:25:59 +02:00
Matthias Krüger
df9796f20d
Rollup merge of - tshepang:patch-6, r=jieyouxu
add missing word in doc comment (part 2)
2025-04-08 21:25:59 +02:00
Matthias Krüger
7661224f1e
Rollup merge of - Skgland:139455-went-too-far, r=Veykril
Revert r-a changes of 

I discovered https://github.com/rust-lang/rust/issues/132735#issuecomment-2784205477 that I might have done too much in  by also removing support in r-a.
So this reverts the commit with the changes to r-a.

r? RalfJung
2025-04-08 21:25:58 +02:00
Matthias Krüger
894f471d1e
Rollup merge of - compiler-errors:restrict-queries, r=oli-obk
Restrict some queries by def-kind more

Random cleanup. I prefer things to assert more so as to catch bugs :)

r? oli-obk
2025-04-08 21:25:57 +02:00
Michael Goulet
68692b7fbb Instantiate higher-ranked transmute goal 2025-04-08 17:00:29 +00:00
Matthias Krüger
1cbf8b56af
Rollup merge of - xizheyin:issue-139359, r=lcnr
clean: remove Deref<Target=RegionKind> impl for Region and use `.kind()`

Closes 

r? `@lcnr`
2025-04-08 18:05:34 +02:00
Matthias Krüger
74c2a9be5b
Rollup merge of - tshepang:patch-5, r=jieyouxu
add missing word in doc comment
2025-04-08 18:05:32 +02:00
Matthias Krüger
9ea9339435
Rollup merge of - compiler-errors:suppress-stack-overflow, r=lcnr
Fix stack overflow in exhaustiveness due to recursive HIR opaque hidden types

This fixes several spicy non-trivial recursive opaque definitions inferred from HIR typeck, ensuring that they don't cause stack overflows in exhaustiveness code, which currently reveals opaques manually in a way that is not overflow aware (as opposed to something like the normalizer folders).

These should eventually be outright rejected, but today (some) non-trivial recursive opaque definitions are accepted, and changing that requires an FCP, so for now just make sure we don't stack overflow :^)

Fixes https://github.com/rust-lang/rust/issues/139402

r? lcnr
2025-04-08 18:05:31 +02:00
Matthias Krüger
890c6de310
Rollup merge of - jogru0:117437, r=tgross35
document panic behavior of Vec::resize and Vec::resize_with

This adds panic documentation to ´Vec::resize´ and ´Vec::resize_with´. Fixes .
2025-04-08 18:05:29 +02:00
Matthias Krüger
7bc1d3abb9
Rollup merge of - rustbot:docs-update, r=ehuss
Update books

## rust-lang/reference

12 commits in e95ebdfee02514d93f79ec92ae310a804e87f01f..46435cd4eba11b66acaa42c01da5c80ad88aee4b
2025-04-07 14:21:21 UTC to 2025-03-25 20:13:17 UTC

- Update book.toml fix the authors field ()
- Update precedence table for borrow operators ()
- Add the ability for rules to be specified in link definitions ()
- Rework trait parameter patterns ()
- Fix header rules ()
- Add test wrappers ()
- Update tools to Rust 2024 ()
- Define byte ()
- Fix CSS for new footnote style ()
- do not reference LLVM in our definition of UB ()
- Tweak reference for precise capturing in traits ()
- Add edition admonitions ()

## rust-lang/rust-by-example

2 commits in 6f69823c28ae8d929d6c815181c73d3e99ef16d3..0d7964d5b22cf920237ef1282d869564b4883b88
2025-04-07 11:19:31 UTC to 2025-03-29 02:25:52 UTC

- Rename count to index for clarity ()
- Fixing grammar in panic section ()
2025-04-08 18:05:25 +02:00
Matthias Krüger
df57bdf741
Rollup merge of - petrochenkov:errkind-light, r=oli-obk,jieyouxu
compiletest: Stricter parsing for diagnostic kinds

Non-controversial parts of https://github.com/rust-lang/rust/pull/139427 not requiring many changes in the test suite.

r? ``@jieyouxu``
2025-04-08 18:05:22 +02:00
Matthias Krüger
75f3bd6ed0
Rollup merge of - lcnr:rm-var_infos, r=compiler-errors
rm `RegionInferenceContext::var_infos`

we already track this info in the `definitions` field

r? types
2025-04-08 18:05:19 +02:00
bors
d4f880f8ce Auto merge of - lcnr:borrowck-typeck_root, r=oli-obk
borrowck typeck children together with their root

This introduces new cycle errors, even with `feature(inline_const_pat)` removed, see the `non-structural-match-types-cycle-err.rs` test.

The new cycle error happens as the layout of `async`-blocks relies on their `optimized_mir`. As that now depends on `mir_borrowck` of its typeck parent, computing the layout of an `async`-block during MIR building, e.g. when evaluating a named `const` pattern. I think there's currently no way to have a named const pattern whose type references an async block while being allowed? cc `@oli-obk` `@RalfJung`

I cannot think of other cases where we currently rely on the MIR of a typeck children while borrowchecking their parent. The crater run came back without any breakage. My work here will prevent any future features which rely on this as we'll get locked into borrowchecking them together as I continue to work on https://github.com/rust-lang/types-team/issues/129, cc `@rust-lang/types.`

r? compiler-errors
2025-04-08 16:01:37 +00:00
Josh Triplett
fe079c4e57 Update library tracking issue template to set S-tracking-unimplemented
This will help people notice the `S-tracking-*` labels, and if the
tracking issue *is* implemented, they can change the label.
2025-04-08 08:10:41 -07:00
Zalathar
63fcd2419d compiletest: Remove the --logfile flag
This flag is deprecated in libtest, and there's no evidence in-tree of this
flag actually being passed to compiletest.

(For detailed information about test results, bootstrap parses JSON output from
compiletest instead.)
2025-04-08 22:17:58 +10:00
bors
f820b75fee Auto merge of - Zalathar:rollup-5t5xsrw, r=Zalathar
Rollup of 10 pull requests

Successful merges:

 -  (Implement overflow for infinite implied lifetime bounds)
 -  (Make error message for missing fields with `..` and without `..` more consistent)
 -  (Tell LLVM about impossible niche tags)
 -  (compiler: report error when trait object type param reference self)
 -  (Update to new rinja version (askama))
 -  (Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`)
 -  (make it possible to use stage0 libtest on compiletest)
 -  (Fix trait upcasting to dyn type with no principal when there are projections)
 -  (Allow for reparsing failure when reparsing a pasted metavar.)
 -  (Update some comment/docs related to "extern intrinsic" removal)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-08 12:05:54 +00:00
Stan Manilov
245cf8e734 Fix deprecation note for std::intrinsics
Also checked the rest of the mentions of std::mem in the changed file
and they look good to me.
2025-04-08 14:36:12 +03:00
Stuart Cook
42fdd7deee
Rollup merge of - RalfJung:unstable-intrinsics-docs, r=oli-obk
Update some comment/docs related to "extern intrinsic" removal

Follow-up to https://github.com/rust-lang/rust/pull/139455.

r? `@oli-obk`
2025-04-08 20:55:12 +10:00
Stuart Cook
24369adae7
Rollup merge of - nnethercote:fix-139248-AND-fix-139445, r=petrochenkov
Allow for reparsing failure when reparsing a pasted metavar.

Fix some metavar reparsing issues.

Fixes  and .

r? `@petrochenkov`
2025-04-08 20:55:11 +10:00
Stuart Cook
056756c7c4
Rollup merge of - compiler-errors:upcast-no-principal-with-proj, r=oli-obk
Fix trait upcasting to dyn type with no principal when there are projections

 (which I had originally authored, lol) had a subtle bug that is the moral equivalent of , which is that when upcasting from `dyn Principal<Projection = Ty> + AutoTrait` to `dyn AutoTrait`, we were dropping the trait ref for `Principal` but not its projections (if there were any).

With debug assertions enabled, this triggers the assertion I luckily added in a2a0cfe825, but even without debug assertions this is a logical bug since we had a dyn type with just a projection bound but no principal, so it caused a type mismatch.

This does not need an FCP because this should've been covered by the FCP in , but we just weren't testing a case when casting from a `dyn` type with projections 😸

Fixes 

r? ````@oli-obk```` (or anyone)
2025-04-08 20:55:09 +10:00
Stuart Cook
ab80f575c4
Rollup merge of - onur-ozkan:configurable-compiletest-libtest, r=jieyouxu,kobzol
make it possible to use stage0 libtest on compiletest

With https://github.com/rust-lang/rust/pull/119899, building the library tree will require a stage 1 compiler. This is because `compiletest` is defined as a `ToolStd` (since https://github.com/rust-lang/rust/pull/68019) in order to use the in-tree library. As a result, https://github.com/rust-lang/rust/pull/119899 makes certain development workflows more difficult as changes on the compiler tree will now require recompiling `compiletest` each time.

This PR allows switching `ToolStd` to `ToolBootstrap` with a simple boolean option in `bootstrap.toml` to allow `compiletest` to use the stage 0 `libtest` instead.

The changes under `src/ci` are clearly intended to make sure that `compiletest` doesn't break during future bootstrap beta bumps.
2025-04-08 20:55:08 +10:00
Stuart Cook
133cec7363
Rollup merge of - compiler-errors:non-lifetime-binder-diag-hir-wf-check, r=oli-obk
Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`

See comment inline.

Fixes 

r? oli-obk
2025-04-08 20:55:07 +10:00
Stuart Cook
dd682f7750
Rollup merge of - GuillaumeGomez:update-rinja, r=notriddle,lolbinarycat,yotamofek
Update to new rinja version (askama)

Askama maintenance was handed over to rinja maintainers so new `rinja` release is actually `askama`. More information [here](https://blog.guillaume-gomez.fr/articles/2025-03-19+Askama+and+Rinja+merge).

r? ``@notriddle``
2025-04-08 20:55:05 +10:00
Stuart Cook
5913c5248b
Rollup merge of - xtexx:gh-139082, r=compiler-errors
compiler: report error when trait object type param reference self

Fixes .

Emits an error when `Self` is found in the projection bounds of a trait
object. In type aliases, `Self` has no meaning, so `type A = &'static
dyn B` where `trait B = Fn() -> Self` will expands to `type A = &'static
Fn() -> Self` which is illegal, causing the region solver to bail out
when hitting the uninferred Self.

r? ````@compiler-errors```` ````@fee1-dead````
2025-04-08 20:55:04 +10:00
Stuart Cook
7ffa56c3a3
Rollup merge of - scottmcm:assert-impossible-tags, r=WaffleLapkin
Tell LLVM about impossible niche tags

I was trying to find a better way of emitting discriminant calculations, but sadly had no luck.

So here's a fairly small PR with the bits that did seem worth bothering:

1. As the [`TagEncoding::Niche` docs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/enum.TagEncoding.html#variant.Niche) describe, it's possible to end up with a dead value in the input that's not already communicated via the range parameter attribute nor the range load metadata attribute.  So this adds an `llvm.assume` in non-debug mode to tell LLVM about that.  (That way it can tell that the sides of the `select` have disjoint possible values.)

2. I'd written a bunch more tests, or at least made them parameterized, in the process of trying things out, so this checks in those tests to hopefully help future people not trip on the same weird edge cases, like when the tag type is `i8` but yet there's still a variant index and discriminant of `258` which doesn't fit in that tag type because the enum is really weird.
2025-04-08 20:55:03 +10:00
Stuart Cook
6257825c8f
Rollup merge of - compiler-errors:tweak-default-value-err, r=lcnr
Make error message for missing fields with `..` and without `..` more consistent

When `..` is not present, we say "missing field `bar` in initializer", but when it is present we say "missing mandatory field `bar`". I don't see why the primary error message should change, b/c the root cause is the same.

Let's harmonize these error messages and instead use a label to explain that `..` is required b/c it's not defaulted.

r? estebank
2025-04-08 20:55:01 +10:00
Stuart Cook
2b1afcbd1a
Rollup merge of - compiler-errors:overflow-implied-bounds, r=lcnr
Implement overflow for infinite implied lifetime bounds

Not a great error message, but better than a hang

Fixes 
Fixes 
Fixes 

r? lcnr
2025-04-08 20:54:58 +10:00
Ralf Jung
742b378371 make hover_feature test less fragile 2025-04-08 12:13:17 +02:00