rust/tests/ui/associated-consts
Keith-Cancel 73a991fb9d Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized.
Revert, but without type const.

Update symbol for feature err, then update suggestion output, and lastly update tests that change because of those.

Update these new tests with the correct syntax, and few existing tests with the new outputs the merge with main added.

Fix for tidyfmt and some errors when manually resolving a merge conflicts.

Update these tests to use update error messages and type const syntax.

Update comments and error message to use new syntax instead of old type_const attribute.

Remove the type_const attribute

update some more tests to use the new syntax.

Update these test cases.

update feature gate test

Change gate logic for `mgca_type_const_syntax` to work also if `min_generic_const_args` is enabled.

Create a new feature gate that checks for the feature before expansion.

Make rustfmt handle the `type const` syntax correctly.

Add a convience method to check if a RhsKind is type const.

Rename `Const` discriminant to `Body` for `ConstItemRhsKind`

Give the `TraitItemKind` flag an enum instead of a simple bool to better describe what the flag is for.

Update formatting for these match statements.

Update clippy test to use type const syntax.

Update test to use type const syntax.

update rustfmt to match ast items.

Update clippy to match ast and hir items.

Few more test cases that used old attribute, instead of 'type const'

Update to match the output from the feature gate checks.

tidyfmt adjustments.

Update the is_type_const, so I can constrain record!(..) in encoder.rs

Update conditional compilation test.

Move the feature gate to after expansion to allow for cfg(...) to work.

Update some more tests to use the new syntax.

Update type const tests in associated-const-bindings to use new syntax.

Don't check based off the attribute, but the item here.

Update some tests outside of the const_generics folder that were using #[type_const]

update the tests in associated consts that use #[type_const] to use type const

Update these mgca tests with the type const syntax.

Add a flag to TraitItemKind for detecting type const for now. Maybe later change ItemConstRhs to have optional consts but that touches a lot more lines of code.

Don't need into for these now that it's a query.

Add is_type_const query to handle foreign def ids.

update this test to use type const syntax.

Fix logic here, we only want to lower if there is expression in this case.

Update built-in macros to use ConstItemRhsKind

Update more instance of the old ConstItemRhs.

Rename ConstItemKind to ConstItemRhsKind, I noticed there is a typed called ConstantItemKind, so add the Rhs to the name to avoid confusion.

Update lower to use ConstItemKind

Add an other helper method to check if the rhs kinda has an expr.

Update item parse to use ConstItemKind enum.

Felt the field name could a be little clear when editing a few other things.

Change the ConstItem struct see know if we have a type const or regular const.

Make sure this syntax is properly feature gated.
2026-02-09 07:59:24 -08:00
..
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-access.rs clean up some tests 2026-01-31 14:01:54 +01:00
associated-const-ambiguity-report.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-ambiguity-report.stderr More sophisticated span trimming 2025-02-21 00:41:17 +00:00
associated-const-array-len.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-array-len.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
associated-const-const-eval.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-cross-crate-const-eval.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-cross-crate-defaults.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-cross-crate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-dead-code.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-dead-code.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
associated-const-generic-obligations.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-generic-obligations.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
associated-const-impl-wrong-lifetime.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-impl-wrong-lifetime.stderr recurse into refs when comparing tys for diagnostics 2023-12-07 23:00:46 -05:00
associated-const-impl-wrong-type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-impl-wrong-type.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
associated-const-in-global-const.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-in-trait.rs mGCA: Make traits with type assoc consts dyn compatible... 2026-01-21 12:53:44 +01:00
associated-const-in-trait.stderr mGCA: Make traits with type assoc consts dyn compatible... 2026-01-21 12:53:44 +01:00
associated-const-inherent-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-marks-live-code.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-match-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-no-item.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-no-item.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
associated-const-outer-ty-refs.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-overwrite-default.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-private-impl.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-private-impl.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
associated-const-public-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-range-match-patterns.rs Gate 2018 UI tests 2025-11-27 14:13:58 -05:00
associated-const-resolution-order.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-self-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-trait-bound.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-type-parameter-arrays-2.rs Bless tests due to extra error reporting due to normalizing types that are not WF 2024-11-27 03:34:58 +00:00
associated-const-type-parameter-arrays-2.stderr Bless tests due to extra error reporting due to normalizing types that are not WF 2024-11-27 03:34:58 +00:00
associated-const-type-parameter-arrays.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-const-type-parameter-arrays.stderr generic_const_exprs: suggest to add the feature, not use it 2023-11-30 20:59:51 +01:00
associated-const-type-parameter-pattern.rs review comments: reword messages and simplify logic 2024-12-04 20:49:05 +00:00
associated-const-type-parameter-pattern.stderr lower bodies' params to thir before the body's value 2025-05-21 09:17:11 -07:00
associated-const-type-parameters.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-type-parameters.stderr bless tests with new lint messages 2025-08-19 21:27:10 +02:00
associated-const-ufcs-infer-trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-use-default.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const-use-impl-of-same-trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-const.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
constant-trait-item-reference-selection-26095.rs Rehome tests/ui/issues/ tests [2/?] 2025-08-02 15:29:16 -04:00
defaults-cyclic-fail.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
defaults-cyclic-fail.stderr Enable ConstPropLint for promoteds 2024-02-17 10:44:46 +05:30
defaults-cyclic-pass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
defaults-not-assumed-fail.rs Use the informative error as the main const eval error message 2025-06-02 15:37:15 +00:00
defaults-not-assumed-fail.stderr Do not mention -Zmacro-backtrace for std macros that are a wrapper around a compiler intrinsic 2026-01-26 17:34:31 +00:00
defaults-not-assumed-pass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
double-elided.rs Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope 2024-06-14 11:05:35 -04:00
freeze.rs Expose Freeze trait again 2024-02-29 13:55:11 +00:00
infer-placeholder-in-non-suggestable-pos.rs Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope 2024-06-14 11:05:35 -04:00
infer-placeholder-in-non-suggestable-pos.stderr Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope 2024-06-14 11:05:35 -04:00
issue-24949-assoc-const-static-recursion-impl.rs Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
issue-24949-assoc-const-static-recursion-impl.stderr Accept trivial consts based on trivial consts 2025-10-27 13:36:57 -04:00
issue-24949-assoc-const-static-recursion-trait-default.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24949-assoc-const-static-recursion-trait-default.stderr Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
issue-24949-assoc-const-static-recursion-trait.rs Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
issue-24949-assoc-const-static-recursion-trait.stderr Mention crate being analysized in query description 2025-10-31 21:20:08 +00:00
issue-47814.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-47814.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-58022.rs Avoid a track_errors by bubbling up most errors from check_well_formed 2023-10-20 08:46:27 +00:00
issue-58022.stderr Retire hir::*ItemRef. 2025-07-13 13:50:01 +00:00
issue-63496.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-63496.stderr Retire hir::*ItemRef. 2025-07-13 13:50:01 +00:00
issue-69020-assoc-const-arith-overflow.noopt.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-69020-assoc-const-arith-overflow.opt.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-69020-assoc-const-arith-overflow.opt_with_overflow_checks.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-69020-assoc-const-arith-overflow.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-88599-ref-self.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-93775.rs Make sure we don't overrun the stack in canonicalizer 2025-02-21 18:24:05 +00:00
issue-110933.rs Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized. 2026-02-09 07:59:24 -08:00
mismatched_impl_ty_1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
mismatched_impl_ty_2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
mismatched_impl_ty_3.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
shadowed-const.rs Resolve assoc item bindings by namespace 2023-12-07 22:33:56 +01:00
shadowed-const.stderr Resolve assoc item bindings by namespace 2023-12-07 22:33:56 +01:00
trait-associated-const-usage-43483.rs Rehome tests/ui/issues/ tests [3/?] 2025-08-04 16:43:53 -04:00
traits-associated-consts-ice-56870.rs Allow function_casts_as_integer in non-related ui tests 2025-11-10 16:38:28 +01:00
type-const-in-array-len-wrong-type.rs Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized. 2026-02-09 07:59:24 -08:00
type-const-in-array-len-wrong-type.stderr Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized. 2026-02-09 07:59:24 -08:00
type-const-in-array-len.rs Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized. 2026-02-09 07:59:24 -08:00
type-const-in-array-len.stderr Reorganize tests that no longer crash 2026-02-06 14:44:04 +09:00
wrong-projection-self-ty-invalid-bivariant-arg.rs Relate receiver invariantly in method probe for Mode::Path 2024-09-16 10:55:07 -04:00
wrong-projection-self-ty-invalid-bivariant-arg.stderr Relate receiver invariantly in method probe for Mode::Path 2024-09-16 10:55:07 -04:00
wrong-projection-self-ty-invalid-bivariant-arg2.rs Relate receiver invariantly in method probe for Mode::Path 2024-09-16 10:55:07 -04:00
wrong-projection-self-ty-invalid-bivariant-arg2.stderr fallout :skull_emoji: 2025-02-14 00:37:23 +01:00