rust/tests
bors 72b21e1a64 Auto merge of #139558 - camelid:mgca-const-items, r=oli-obk,BoxyUwU
mgca: Add ConstArg representation for const items

tracking issue: rust-lang/rust#132980
fixes rust-lang/rust#131046
fixes rust-lang/rust#134641

As part of implementing `min_generic_const_args`, we need to distinguish const items that can be used in the type system, such as in associated const equality projections, from const items containing arbitrary const code, which must be kept out of the type system. Specifically, all "type consts" must be either concrete (no generics) or generic with a trivial expression like `N` or a path to another type const item.

To syntactically distinguish these cases, we require, for now at least, that users annotate all type consts with the `#[type_const]` attribute. Then, we validate that the const's right-hand side is indeed eligible to be a type const and represent it differently in the HIR.

We accomplish this representation using a new `ConstItemRhs` enum in the HIR, and a similar but simpler enum in the AST. When `#[type_const]` is **not** applied to a const (e.g. on stable), we represent const item right-hand sides (rhs's) as HIR bodies, like before. However, when the attribute is applied, we instead lower to a `hir::ConstArg`. This syntactically distinguishes between trivial const args (paths) and arbitrary expressions, which are represented using `AnonConst`s. Then in `generics_of`, we can take advantage of the existing machinery to bar the `AnonConst` rhs's from using parent generics.
2025-11-08 22:31:33 +00:00
..
assembly-llvm Rollup merge of #147355 - sayantn:masked-loads, r=RalfJung,bjorn3 2025-11-05 10:59:18 +11:00
auxiliary Rollup merge of #147355 - sayantn:masked-loads, r=RalfJung,bjorn3 2025-11-05 10:59:18 +11:00
codegen-llvm Add -Zannotate-moves for profiler visibility of move/copy operations 2025-11-06 15:39:45 -08:00
codegen-units pub async fn implementation coroutine (func::{closure#0}) is monomorphized, when func itself is monomorphized 2025-09-01 13:45:00 +07:00
coverage Add coverage scope for controlling paths in code coverage 2025-10-27 12:54:24 +01:00
coverage-run-rustdoc
crashes Auto merge of #139558 - camelid:mgca-const-items, r=oli-obk,BoxyUwU 2025-11-08 22:31:33 +00:00
debuginfo Minor fixes to StdNonZeroNumberProvider for gdb 2025-11-05 11:42:54 -07:00
incremental Add a fast path for lowering trivial consts 2025-10-25 16:59:53 -04:00
mir-opt Rollup merge of #147925 - fneddy:fix_big_endian_GVN_tests, r=saethlin 2025-11-05 10:59:18 +11:00
pretty Remove QPath::LangItem from ranges 2025-10-27 21:19:38 -05:00
run-make Auto merge of #148573 - matthiaskrgr:rollup-cn5viia, r=matthiaskrgr 2025-11-06 14:52:37 +00:00
run-make-cargo Skip the panic-immediate-abort-works test when cross-compiling 2025-09-22 21:13:38 -04:00
rustdoc Auto merge of #139558 - camelid:mgca-const-items, r=oli-obk,BoxyUwU 2025-11-08 22:31:33 +00:00
rustdoc-gui rustdoc-search: add test case for throbber 2025-10-07 12:59:58 -07:00
rustdoc-js rustdoc-search: remove broken index special case 2025-11-05 23:41:43 -07:00
rustdoc-js-std Add regression test for including derive macros in macro filtering 2025-10-27 16:00:32 +01:00
rustdoc-json Add tests for doc(attribute = "...") attribute 2025-08-28 15:56:30 +02:00
rustdoc-ui Auto merge of #139558 - camelid:mgca-const-items, r=oli-obk,BoxyUwU 2025-11-08 22:31:33 +00:00
ui Auto merge of #139558 - camelid:mgca-const-items, r=oli-obk,BoxyUwU 2025-11-08 22:31:33 +00:00
ui-fulldeps When more than a single impl and less than 4 could apply, point at them 2025-10-31 20:44:01 +00:00
COMPILER_TESTS.md