rust/tests
bors 9f6cd6defb Auto merge of #151085 - Keith-Cancel:mgca2, r=BoxyUwU
Fix ICE: When Trying to check visibility of a #[type_const], check RHS instead.

This PR fixes https://github.com/rust-lang/rust/issues/150956 for min_const_generic_args https://github.com/rust-lang/rust/issues/132980. 

The first part of this PR checks in `reachable.rs` if we have a type const use `visit_const_item_rhs(init);` instead of calling `const_eval_poly_to_alloc()`

The second part is I noticed that if `const_eval_poly_to_alloc()` returns a `ErrorHandled::TooGeneric` then switches to `visit_const_item_rhs()`. So further up `const_eval_poly_to_alloc()` call order it eventual gets to `eval_in_interpreter()`. So I added a debug_assert in `eval_in_interpreter()` if we happen to try and run CTFE on a `type_const`.

The other bit is just a test case, and some duplicated code I noticed.

While the PR does get rid of the ICE for a type_const with `pub` visibility. If I try using the const though it will ICE with the following:
```
error: internal compiler error: /home/keith/GitHub/rust_kc/compiler/rustc_const_eval/src/check_consts/qualifs.rs:355:13: expected ConstKind::Param or ConstKind::Value here, found UnevaluatedConst { def: DefId(20:4 ~ colorkit[c783]::TYPE_CONST), args: [] }


thread 'rustc' (819687) panicked at /home/keith/GitHub/rust_kc/compiler/rustc_const_eval/src/check_consts/qualifs.rs:355:13:
```

I suspect it is a similar issue to inherent associated consts. Since if I apply the same fix I had here:
https://github.com/rust-lang/rust/pull/150799#discussion_r2676504639

I then can use the const  internally and in external crates without any issues.
Although, did not include that fix since if it is a similar issue it would need to be addressed elsewhere.

r? @BoxyUwU 
@rustbot label +F-associated_const_equality +F-min_generic_const_args
2026-01-17 09:45:42 +00:00
..
assembly-llvm Rollup merge of #150826 - s390x-asm-f16-vector, r=uweigand,tgross35 2026-01-13 09:01:29 +01:00
auxiliary Rollup merge of #150368 - minicore-ordering, r=workingjubilee 2026-01-11 09:56:38 +01:00
codegen-llvm Rollup merge of #150607 - dispatch-ptr-intrinsic, r=workingjubilee 2026-01-15 19:35:46 -05:00
codegen-units address review comments; fix CI 2026-01-01 19:17:11 -05:00
coverage Create place and value indices on-demand. 2025-12-14 16:33:24 +00:00
coverage-run-rustdoc
crashes Bless other tests 2026-01-07 09:33:40 +08:00
debuginfo Run dummy_span.rs test with SimplifyComparisonIntegral 2026-01-14 18:57:17 +08:00
incremental Implement incremental caching for derive macro expansions 2026-01-16 07:36:36 +01:00
mir-opt Rollup merge of #151207 - always-discriminate-prelim, r=Zalathar 2026-01-17 11:47:19 +11:00
pretty Explicitly export core and std macros 2026-01-13 08:47:48 +01:00
run-make Disable dump-ice-to-disk on i686-pc-windows-msvc 2026-01-16 09:27:45 +08:00
run-make-cargo tests/run-make-cargo/same-crate-name-and-macro-name: New regression test 2025-12-17 11:21:27 +01:00
rustdoc-gui Reduce rustdoc GUI flakyness, take 2 2026-01-14 22:47:53 +01:00
rustdoc-html Rollup merge of #151120 - ice-deprecated-note-on-reexport, r=lolbinarycat 2026-01-17 11:47:18 +11:00
rustdoc-js Auto merge of #149370 - Zalathar:rollup-6fkk5x4, r=Zalathar 2025-11-27 07:30:25 +00:00
rustdoc-js-std Explicitly export core and std macros 2026-01-13 08:47:48 +01:00
rustdoc-json
rustdoc-ui Rollup merge of #150934 - move-doc-attr-checks, r=JonathanBrouwer 2026-01-13 09:01:31 +01:00
ui Auto merge of #151085 - Keith-Cancel:mgca2, r=BoxyUwU 2026-01-17 09:45:42 +00:00
ui-fulldeps Rollup merge of #151096 - rm-providers-deref, r=oli-obk 2026-01-14 11:05:42 +01:00
COMPILER_TESTS.md