Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ca8b65c
Rollup merge of #162948 - heiher:loong-emit-target-abi, r=nikic
JonathanBrouwer Sep 21, 2026
1a764fd
Rollup merge of #162600 - maxdexh:box-generalize, r=clarfonthey
JonathanBrouwer Sep 21, 2026
dde9a10
Auto merge of #163119 - JonathanBrouwer:rollup-YdZQI8k, r=JonathanBro…
bors Sep 21, 2026
0a82ee9
Rollup merge of #162137 - Randl:test-fixed-issues-1, r=chenyukang
JonathanBrouwer Sep 21, 2026
8a305be
Rollup merge of #162889 - Zalathar:non-query, r=Enselic
JonathanBrouwer Sep 21, 2026
fa48976
Rollup merge of #163117 - RalfJung:bootstrap-miri, r=clubby789
JonathanBrouwer Sep 21, 2026
e704fd3
Rollup merge of #163123 - tshepang:rdg-sync, r=tshepang
JonathanBrouwer Sep 21, 2026
4a283a8
Auto merge of #163129 - JonathanBrouwer:rollup-jtyh9y4, r=JonathanBro…
bors Sep 21, 2026
67e3837
Auto merge of #161827 - GuillaumeGomez:trait-mut-mismatch, r=mejrs
bors Sep 21, 2026
c256b06
Auto merge of #162499 - GuillaumeGomez:subtree-update_cg_gcc_2026-09-…
bors Sep 22, 2026
103e2b3
Auto merge of #161938 - jackh726:polonius-lazy-liveness-final, r=lqd
bors Sep 22, 2026
4b7ac2d
Auto merge of #161574 - Walnut356:linux_lldb, r=jieyouxu
bors Sep 23, 2026
f41144c
rename GCA features
khyperia Sep 25, 2026
acc4592
Auto merge of #163306 - khyperia:gca-rename, r=BoxyUwU
bors Sep 25, 2026
e94a106
Auto merge of #163326 - Mark-Simulacrum:bump-release, r=Mark-Simulacrum
bors Sep 26, 2026
b8afe7f
Auto merge of #163325 - yttersian:core-slice-docs-fix, r=jhpratt
bors Sep 27, 2026
b09a3e2
do not complain about unstable target features on nightly
RalfJung Sep 28, 2026
0d3998e
Auto merge of #129036 - clarfonthey:nonzero-conversions, r=nia-e
bors Sep 28, 2026
180ce10
Rollup merge of #161015 - tgross35:stabilize-funnel-shifts, r=nia-e
tgross35 Sep 29, 2026
c8e4d1c
Rollup merge of #161712 - theemathas:stab-into-ok-err, r=nia-e
tgross35 Sep 29, 2026
a1fd9e1
Rollup merge of #162493 - jakos-sec:ubsan-runtime-minimal, r=rcvalle
tgross35 Sep 29, 2026
4defbf2
Rollup merge of #163428 - RalfJung:unstable-target-feature, r=petroch…
tgross35 Sep 29, 2026
69a1b06
Rollup merge of #163444 - Kobzol:run-make-stable-benchmarks, r=jieyouxu
tgross35 Sep 29, 2026
52d7e3b
Rollup merge of #163447 - aerooneqq:two-sided-index-in-metadata, r=pe…
tgross35 Sep 29, 2026
748bdf0
Rollup merge of #163459 - petrak-at-canonical:vec-try-remove, r=hanna…
tgross35 Sep 29, 2026
46a85c1
Auto merge of #163465 - tgross35:rollup-VJQsybH, r=tgross35
bors Sep 29, 2026
9c779ca
Auto merge of #163361 - cuviper:sync-advance_back_by, r=Darksonn
bors Sep 29, 2026
a9048bb
Prepare for merging from rust-lang/rust
tshepang Sep 30, 2026
623bc26
Merge ref '7d2cd0fbc092' from rust-lang/rust
tshepang Sep 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
56fad885ebfb0447660870715da4dfa75deae93d
7d2cd0fbc092625ea371da704f15f80216d2220e
6 changes: 3 additions & 3 deletions src/const-generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type Alias = [u8; ANON];
When we go through HIR ty lowering for the array type in `Alias`, we will lower the array length too, and feed `type_of(ANON) -> usize`.
This will effectively set the type of the `ANON` const item during some later part of the compiler rather than when constructing the HIR.

After all of this desugaring has taken place the final representation in the type system (ie as a `ty::Const`) is a `ConstKind::Alias` with the `DefId` of the `AnonConst`. This is equivalent to how we would representa a usage of an actual const item if we were to represent them without going through an anon const (e.g. when `min_generic_const_args` is enabled).
After all of this desugaring has taken place the final representation in the type system (ie as a `ty::Const`) is a `ConstKind::Alias` with the `DefId` of the `AnonConst`. This is equivalent to how we would representa a usage of an actual const item if we were to represent them without going through an anon const (e.g. when `gca_min_const_items` is enabled).

This allows the representation for const "aliases" to be the same as the representation of `TyKind::Alias`. Having a proper HIR body also allows for a *lot* of code re-use, e.g. we can reuse HIR typechecking and all of the lowering steps to MIR where we can then reuse const eval.

Expand Down Expand Up @@ -141,7 +141,7 @@ In some sense we only allow generic parameters here when they are semantically u
In the previous example the anon const can be evaluated for any type parameter `T` because raw pointers to sized types always have the same size (e.g. `8` on 64bit platforms).

When detecting that we evaluated an anon const that syntactically contained generic parameters, but did not actually depend on them for evaluation to succeed, we emit the [`const_evaluatable_unchecked` FCW][cec_fcw].
This is intended to become a hard error once we stabilize more ways of using generic parameters in const arguments, for example `min_generic_const_args` or (the now dead) `generic_const_exprs`.
This is intended to become a hard error once we stabilize more ways of using generic parameters in const arguments, for example `gca_min_const_items` or (the now dead) `generic_const_exprs`.

The implementation for this FCW can be found here: [`const_eval_resolve_for_typeck`]

Expand Down Expand Up @@ -182,7 +182,7 @@ It is currently unclear what the right way to make `generic_const_parameter_type

`generic_const_exprs` would have allowed for anon consts with types referencing generic parameters, but that design wound up unworkable.

`min_generic_const_args` will allow for some expressions (for example array construction) to be representable without an anon const and therefore without running into these issues, though whether this is *enough* has yet to be determined.
`gca_min_const_items` will allow for some expressions (for example array construction) to be representable without an anon const and therefore without running into these issues, though whether this is *enough* has yet to be determined.

## Checking types of const arguments

Expand Down
2 changes: 1 addition & 1 deletion src/normalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn bar() {
```

This is likely to change as const generics functionality is improved.
For example, `feature(associated_const_equality)` and `feature(min_generic_const_args)` both require handling const aliases similarly to types (without an anonymous constant wrapping all const args).
For example, `feature(associated_const_equality)` and `feature(gca_min_const_items)` both require handling const aliases similarly to types (without an anonymous constant wrapping all const args).

## What is normalization

Expand Down
13 changes: 4 additions & 9 deletions src/tests/misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@ This is a bootstrap/compiler implementation detail, but it can also be useful fo
This is useful because some behaviors of the compiler (e.g. diagnostics)
can differ depending on whether the compiler is nightly or not.

In `ui` tests and other test suites that support `//@ rustc-env`, you can specify

```rust,ignore
// Force unstable features to be usable on stable rustc
//@ rustc-env:RUSTC_BOOTSTRAP=1

// Or force nightly rustc to pretend it is a stable rustc
//@ rustc-env:RUSTC_BOOTSTRAP=-1
```
Note that setting `RUSTC_BOOTSTRAP` in ui tests (e.g. via `//@ rustc-env`) is pointless since ui
tests inherit the bootstrap env var from bootstrap (so it's set to `1` by default), and since
compiletest itself passes `-Z` flags (so `-1` breaks the test). To test stable-only behavior, you
need to write a `run-make` test instead.

For `run-make`/`run-make-cargo` tests, `//@ rustc-env` is not supported.
You can do something like the following for individual `rustc` invocations.
Expand Down
Loading