rust/tests/ui/const-generics/mgca
Keith-Cancel 4c93efae2b Fix ICE: When Trying to check visibility of a #[type_const], check RHS instead.
We want to evaluate the rhs of a type_const.

Also added an early return/guard in eval_in_interpreter which is used in functions like `eval_to_allocation_raw_provider`

Lastly add a debug assert to `thir_body()` if we have gotten there with a type_const something as gone wrong.

Get rid of a call to is_type_const() and instead use a match arm.

Change this is_type_const() check to a debug_assert!()

Change to use an if else statment instead.

Update type_const-pub.rs

Fix formatting.

Noticed that this is the same check as is_type_const() centralize it.

Add test case for pub type_const.
2026-01-16 20:30:58 -08:00
..
adt_expr_arg_simple.rs mgca: Type-check fields of ADT constructor expr const args 2026-01-08 10:52:58 -08:00
adt_expr_arg_simple.stderr Lower hir::ConstArgKind::Struct to a ValTree 2025-12-23 13:54:59 +00:00
adt_expr_arg_tuple_expr_fail.rs mgca: Type-check fields of tuple expr const args 2026-01-08 11:09:07 -08:00
adt_expr_arg_tuple_expr_fail.stderr mgca: Type-check fields of tuple expr const args 2026-01-08 11:09:07 -08:00
adt_expr_erroneuous_inits.rs Lower hir::ConstArgKind::Struct to a ValTree 2025-12-23 13:54:59 +00:00
adt_expr_erroneuous_inits.stderr Add span field for ConstArg 2026-01-07 08:44:32 +08:00
adt_expr_fields_type_check.rs mgca: Type-check fields of ADT constructor expr const args 2026-01-08 10:52:58 -08:00
adt_expr_fields_type_check.stderr mgca: Type-check fields of ADT constructor expr const args 2026-01-08 10:52:58 -08:00
adt_expr_infers_from_value.rs Lower hir::ConstArgKind::Struct to a ValTree 2025-12-23 13:54:59 +00:00
ambiguous-assoc-const.rs mgca: Lower all const paths as ConstArgKind::Path 2025-03-04 10:11:13 -05:00
ambiguous-assoc-const.stderr mgca: Lower all const paths as ConstArgKind::Path 2025-03-04 10:11:13 -05:00
array-expr-complex.rs Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
array-expr-complex.stderr Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
array-expr-empty.rs Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
array-expr-empty.stderr Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
array-expr-simple.rs Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
array-expr-type-mismatch-in-where-bound.rs Emit error instead of delayed bug when meeting mismatch type for const 2026-01-13 21:36:53 +09:00
array-expr-type-mismatch-in-where-bound.stderr Emit error instead of delayed bug when meeting mismatch type for const 2026-01-13 21:36:53 +09:00
array-expr-with-assoc-const.rs Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
array-expr-with-macro.rs Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
array-expr-with-struct.rs Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
array-expr-with-tuple.rs Add mGCA array expression tests 2026-01-10 12:45:26 +09:00
assoc-const-without-type_const.rs mgca: Lower all const paths as ConstArgKind::Path 2025-03-04 10:11:13 -05:00
assoc-const-without-type_const.stderr mgca: Lower all const paths as ConstArgKind::Path 2025-03-04 10:11:13 -05:00
assoc-const.rs mgca: Lower all const paths as ConstArgKind::Path 2025-03-04 10:11:13 -05:00
bad-type_const-syntax.rs fix associated_const_equality tests 2025-11-08 13:50:48 -05:00
bad-type_const-syntax.stderr fix associated_const_equality tests 2025-11-08 13:50:48 -05:00
concrete-expr-with-generics-in-env.rs Perform WF-checking on type_const RHS's 2025-11-08 23:05:08 -05:00
const-arg-coherence-conflicting-methods.rs Check that impls of #[type_const] consts also have the attr 2025-11-08 23:05:08 -05:00
const-arg-coherence-conflicting-methods.stderr Check that impls of #[type_const] consts also have the attr 2025-11-08 23:05:08 -05:00
const-ctor-overflow-eval.rs add const ctor support 2026-01-06 15:04:25 +00:00
const-ctor-overflow-eval.stderr add const ctor support 2026-01-06 15:04:25 +00:00
const-ctor-with-error.rs add const ctor support 2026-01-06 15:04:25 +00:00
const-ctor-with-error.stderr add const ctor support 2026-01-06 15:04:25 +00:00
const-ctor.rs add const ctor support 2026-01-06 15:04:25 +00:00
early-bound-param-lt-bad.rs Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
early-bound-param-lt-bad.stderr Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
explicit_anon_consts.rs Merge associated_const_equality feature gate into MGCA 2026-01-05 12:31:42 +08:00
explicit_anon_consts.stderr mgca: Re-merge split out tests 2026-01-01 18:12:34 -08:00
explicit_anon_consts_literals_hack.rs MGCA: literals support 2026-01-08 20:29:00 +05:00
higher-ranked-lts-bad.rs Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
higher-ranked-lts-bad.stderr Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
higher-ranked-lts-good.rs Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
inherent-const-gating.rs mgca: Lower all const paths as ConstArgKind::Path 2025-03-04 10:11:13 -05:00
inherent-const-gating.stderr mgca: Lower all const paths as ConstArgKind::Path 2025-03-04 10:11:13 -05:00
late-bound-param-lt-bad.rs Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
late-bound-param-lt-bad.stderr Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
missing_generic_params.rs Require generic params for const generic params 2025-06-13 07:48:00 +00:00
missing_generic_params.stderr Require generic params for const generic params 2025-06-13 07:48:00 +00:00
multi_braced_direct_const_args.rs Syntactically distinguish anon const const args 2025-12-12 15:45:37 +00:00
printing_valtrees_supports_non_values.rs mgca: Type-check fields of ADT constructor expr const args 2026-01-08 10:52:58 -08:00
printing_valtrees_supports_non_values.stderr mgca: Type-check fields of ADT constructor expr const args 2026-01-08 10:52:58 -08:00
projection-error.rs fix associated_const_equality tests 2025-11-08 13:50:48 -05:00
projection-error.stderr Merge E0412 into E0425 2025-12-02 18:25:13 +00:00
resolution-with-inherent-associated-types.rs Add regression test for 141845 2025-12-05 00:39:55 +09:00
resolution-with-inherent-associated-types.stderr Add regression test for 141845 2025-12-05 00:39:55 +09:00
selftyalias-containing-param.rs Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
selftyalias-containing-param.stderr Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
selftyparam.rs Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
selftyparam.stderr Use more principled check for generics in const ops 2026-01-01 18:12:34 -08:00
struct_expr_with_macros.rs Introduce hir::ConstArgKind::Struct 2025-12-23 13:54:59 +00:00
tuple_ctor_arg_simple.rs init impl 2026-01-04 15:12:39 +00:00
tuple_ctor_complex_args.rs init impl 2026-01-04 15:12:39 +00:00
tuple_ctor_complex_args.stderr init impl 2026-01-04 15:12:39 +00:00
tuple_ctor_erroneous.rs init impl 2026-01-04 15:12:39 +00:00
tuple_ctor_erroneous.stderr Add span field for ConstArg 2026-01-07 08:44:32 +08:00
tuple_ctor_in_array_len.rs init impl 2026-01-04 15:12:39 +00:00
tuple_ctor_in_array_len.stderr init impl 2026-01-04 15:12:39 +00:00
tuple_ctor_nested.rs init impl 2026-01-04 15:12:39 +00:00
tuple_ctor_type_relative.rs init impl 2026-01-04 15:12:39 +00:00
tuple_expr_arg_bad-issue-151048.rs Add test for issue 151048 2026-01-14 20:59:41 +08:00
tuple_expr_arg_bad-issue-151048.stderr Add test for issue 151048 2026-01-14 20:59:41 +08:00
tuple_expr_arg_complex.rs Rename tests for const tuple properly 2026-01-11 11:26:10 +08:00
tuple_expr_arg_complex.stderr Rename tests for const tuple properly 2026-01-11 11:26:10 +08:00
tuple_expr_arg_mismatch_type.rs Rename tests for const tuple properly 2026-01-11 11:26:10 +08:00
tuple_expr_arg_mismatch_type.stderr Rename tests for const tuple properly 2026-01-11 11:26:10 +08:00
tuple_expr_arg_simple.rs Rename tests for const tuple properly 2026-01-11 11:26:10 +08:00
type_as_const_in_array_len.rs init impl 2026-01-04 15:12:39 +00:00
type_as_const_in_array_len.stderr init impl 2026-01-04 15:12:39 +00:00
type_const-array-return.rs Fix ICE: can't type-check body of DefId, since type_consts don't have a body. 2026-01-09 14:45:33 -08:00
type_const-generic-param-in-type.gate.stderr Forbid generic parameters in types of #[type_const] items 2026-01-04 07:21:35 +03:00
type_const-generic-param-in-type.nogate.stderr Forbid generic parameters in types of #[type_const] items 2026-01-04 07:21:35 +03:00
type_const-generic-param-in-type.rs Forbid generic parameters in types of #[type_const] items 2026-01-04 07:21:35 +03:00
type_const-inherent-const-omitted-type.rs Fix ICE: can't type-check body of DefId, since type_consts don't have a body. 2026-01-09 14:45:33 -08:00
type_const-inherent-const-omitted-type.stderr Fix ICE: can't type-check body of DefId, since type_consts don't have a body. 2026-01-09 14:45:33 -08:00
type_const-mismatched-types.rs Check type_const type is ConstParamTy_ and that RHS matches it 2025-11-08 23:05:08 -05:00
type_const-mismatched-types.stderr Check type_const type is ConstParamTy_ and that RHS matches it 2025-11-08 23:05:08 -05:00
type_const-not-constparamty.rs Syntactically distinguish anon const const args 2025-12-12 15:45:37 +00:00
type_const-not-constparamty.stderr Syntactically distinguish anon const const args 2025-12-12 15:45:37 +00:00
type_const-on-generic-expr.rs Lower hir::ConstArgKind::Struct to a ValTree 2025-12-23 13:54:59 +00:00
type_const-on-generic-expr.stderr Lower hir::ConstArgKind::Struct to a ValTree 2025-12-23 13:54:59 +00:00
type_const-on-generic_expr-2.rs Lower hir::ConstArgKind::Struct to a ValTree 2025-12-23 13:54:59 +00:00
type_const-on-generic_expr-2.stderr Lower hir::ConstArgKind::Struct to a ValTree 2025-12-23 13:54:59 +00:00
type_const-only-in-impl-omitted-type.rs Fix ICE: can't type-check body of DefId, since type_consts don't have a body. 2026-01-09 14:45:33 -08:00
type_const-only-in-impl-omitted-type.stderr Fix ICE: can't type-check body of DefId, since type_consts don't have a body. 2026-01-09 14:45:33 -08:00
type_const-only-in-impl.rs Merge associated_const_equality feature gate into MGCA 2026-01-05 12:31:42 +08:00
type_const-only-in-impl.stderr Add tests for mismatched type_const 2025-11-08 13:50:48 -05:00
type_const-only-in-trait.rs Merge associated_const_equality feature gate into MGCA 2026-01-05 12:31:42 +08:00
type_const-only-in-trait.stderr Check that impls of #[type_const] consts also have the attr 2025-11-08 23:05:08 -05:00
type_const-pub.rs Fix ICE: When Trying to check visibility of a #[type_const], check RHS instead. 2026-01-16 20:30:58 -08:00
type_const-recursive.rs Fix ICE: can't type-check body of DefId, since type_consts don't have a body. 2026-01-09 14:45:33 -08:00
type_const-recursive.stderr Fix ICE: can't type-check body of DefId, since type_consts don't have a body. 2026-01-09 14:45:33 -08:00
type_const-use.rs Fix ICE: can't type-check body of DefId, since type_consts don't have a body. 2026-01-09 14:45:33 -08:00
unbraced_const_block_const_arg_gated.rs Syntactically distinguish anon const const args 2025-12-12 15:45:37 +00:00
unbraced_const_block_const_arg_gated.stderr Fix parsing of mgca const blocks in array repeat exprs 2025-12-30 11:30:31 -08:00
unexpected-fn-item-in-array.rs Lower fn items as ZST valtrees and delay a bug 2025-02-11 19:16:12 +00:00
unexpected-fn-item-in-array.stderr Lower fn items as ZST valtrees and delay a bug 2025-02-11 19:16:12 +00:00
unused_speculative_def_id.rs dont create unnecessary DefIds under mgca 2025-12-15 22:59:15 +00:00
unused_speculative_def_id.stderr dont create unnecessary DefIds under mgca 2025-12-15 22:59:15 +00:00