rust/tests/ui/specialization
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 Failing test 2024-06-07 14:59:38 -04:00
coherence When more than a single impl and less than 4 could apply, point at them 2025-10-31 20:44:01 +00:00
ctfe [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
defaultimpl Tweak trait modifier errors 2025-08-11 16:58:21 -05:00
fuzzed adjust derive_error 2025-02-13 23:49:09 +01:00
min_specialization Merge E0412 into E0425 2025-12-02 18:25:13 +00:00
soundness [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
anyid-repro-125197.rs Only compute specializes query if specialization is enabled in the crate of the specialized impl 2024-06-07 15:58:50 -04:00
assoc-ty-graph-cycle.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
assoc-ty-graph-cycle.stderr
broken-mir-drop-glue-107228.rs add test for #107228 2024-03-23 13:05:22 +01:00
cross-crate-defaults.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cross-crate-defaults.stderr
default-associated-type-bound-1.rs
default-associated-type-bound-1.stderr When more than a single impl and less than 4 could apply, point at them 2025-10-31 20:44:01 +00:00
default-associated-type-bound-2.rs
default-associated-type-bound-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
default-generic-associated-type-bound.rs
default-generic-associated-type-bound.stderr Mention type parameter in more cases and don't suggest ~const bound already there 2024-12-07 21:37:13 +00:00
default-proj-ty-as-type-of-const-issue-125757.rs Re-enable ConstArgKind::Path lowering by default 2024-09-12 13:56:01 -04:00
default-proj-ty-as-type-of-const-issue-125757.stderr fix(hir_analysis/wfcheck): don't leak {type error} 2024-09-29 23:40:43 -05:00
dont-drop-upcast-candidate.rs Don't drop Upcast candidate in intercrate mode 2024-05-30 19:45:59 -04:00
dont-drop-upcast-candidate.stderr Don't drop Upcast candidate in intercrate mode 2024-05-30 19:45:59 -04:00
issue-33017.rs
issue-33017.stderr Use trait name instead of full constraint in suggestion message 2024-12-07 21:29:58 +00:00
issue-35376.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-35376.stderr
issue-36804.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-36804.stderr
issue-38091-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-38091-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-38091.rs
issue-38091.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-39448.rs Always make inductive cycles as ambig during typeck 2024-03-31 20:44:30 -04:00
issue-39448.stderr Always make inductive cycles as ambig during typeck 2024-03-31 20:44:30 -04:00
issue-39618.rs Always make inductive cycles as ambig during typeck 2024-03-31 20:44:30 -04:00
issue-39618.stderr Always make inductive cycles as ambig during typeck 2024-03-31 20:44:30 -04:00
issue-40582.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-43037.current.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-43037.negative.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-43037.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-44861.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
issue-44861.stderr On unmet trait bound, mention if trait is unstable 2026-01-13 01:16:58 +00:00
issue-45814.current.stderr Do not assemble candidates for default impls 2024-02-13 19:20:13 +00:00
issue-45814.negative.stderr Do not assemble candidates for default impls 2024-02-13 19:20:13 +00:00
issue-45814.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-50452-fail.rs
issue-50452-fail.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-50452.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-50452.stderr
issue-51892.rs
issue-51892.stderr Avoid looking at HIR for trait and impl items 2025-06-30 08:45:43 +00:00
issue-52050.rs
issue-52050.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-59435.rs
issue-59435.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-63716-parse-async.rs Use cfg(false) in UI tests 2025-04-03 21:41:58 +00:00
issue-63716-parse-async.stderr
issue-68830-spurious-diagnostics.rs Stop being so bail-y in candidate assembly 2024-11-21 01:35:34 +00:00
issue-68830-spurious-diagnostics.stderr Merge E0412 into E0425 2025-12-02 18:25:13 +00:00
issue-70442.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-70442.stderr
issue-111232.rs constify From and Into 2025-07-11 08:30:47 +00:00
issue-111232.stderr constify From and Into 2025-07-11 08:30:47 +00:00
non-defaulted-item-fail.rs
non-defaulted-item-fail.stderr
overlap-due-to-unsatisfied-const-bound.rs Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized. 2026-02-09 07:59:24 -08:00
overlap-due-to-unsatisfied-const-bound.stderr Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized. 2026-02-09 07:59:24 -08:00
prefer-specializing-impl-over-default.current.stderr handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
prefer-specializing-impl-over-default.next.stderr handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
prefer-specializing-impl-over-default.rs handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
README-rpass.md
README.md
source-impl-requires-constraining-predicates-ambig.next.stderr Stop using translate_args in the new solver 2024-05-31 09:42:30 -04:00
source-impl-requires-constraining-predicates-ambig.rs NFC add known bug nr to test 2024-11-02 13:33:39 +01:00
source-impl-requires-constraining-predicates.current.stderr Stop using translate_args in the new solver 2024-05-31 09:42:30 -04:00
source-impl-requires-constraining-predicates.next.stderr Stop using translate_args in the new solver 2024-05-31 09:42:30 -04:00
source-impl-requires-constraining-predicates.rs Stop using translate_args in the new solver 2024-05-31 09:42:30 -04:00
specialization-allowed-cross-crate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-allowed-cross-crate.stderr
specialization-assoc-fns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-assoc-fns.stderr
specialization-basics.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-basics.stderr
specialization-cross-crate-no-gate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-cross-crate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-cross-crate.stderr
specialization-default-items-drop-coherence.current.stderr stabilize -Znext-solver=coherence 2024-10-15 13:11:00 +02:00
specialization-default-items-drop-coherence.next.stderr stabilize -Znext-solver=coherence 2024-10-15 13:11:00 +02:00
specialization-default-items-drop-coherence.rs stabilize -Znext-solver=coherence 2024-10-15 13:11:00 +02:00
specialization-default-methods.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-default-methods.stderr
specialization-default-projection.current.stderr handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
specialization-default-projection.next.stderr handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
specialization-default-projection.rs handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
specialization-default-types.current.stderr Remove hir::AssocItemKind. 2025-07-13 13:50:00 +00:00
specialization-default-types.next.stderr Remove hir::AssocItemKind. 2025-07-13 13:50:00 +00:00
specialization-default-types.rs handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
specialization-feature-gate-default.rs
specialization-feature-gate-default.stderr Bless tests 2024-01-13 12:46:58 -05:00
specialization-feature-gate-overlap.rs
specialization-feature-gate-overlap.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
specialization-no-default.rs
specialization-no-default.stderr
specialization-on-projection.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-on-projection.stderr
specialization-out-of-order.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-out-of-order.stderr
specialization-overlap-hygiene.rs
specialization-overlap-hygiene.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
specialization-overlap-negative.rs Ensure that negative auto impls are always applicable 2025-03-04 17:45:18 +00:00
specialization-overlap-negative.stderr Ensure that negative auto impls are always applicable 2025-03-04 17:45:18 +00:00
specialization-overlap-projection.rs stabilize -Znext-solver=coherence 2024-10-15 13:11:00 +02:00
specialization-overlap-projection.stderr stabilize -Znext-solver=coherence 2024-10-15 13:11:00 +02:00
specialization-overlap.rs
specialization-overlap.stderr
specialization-polarity.rs
specialization-polarity.stderr
specialization-projection-alias.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-projection-alias.stderr
specialization-projection.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-projection.stderr
specialization-supertraits.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-supertraits.stderr
specialization-translate-projections-with-lifetimes.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-translate-projections-with-lifetimes.stderr
specialization-translate-projections-with-params.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-translate-projections-with-params.stderr
specialization-translate-projections.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-translate-projections.stderr
trait-specialization-default-methods-55380.rs Add test batch 2 2025-08-27 15:06:05 -04:00
trait-specialization-default-methods-55380.stderr Add test batch 2 2025-08-27 15:06:05 -04:00
transmute-specialization.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
transmute-specialization.stderr

This directory contains the test for incorrect usage of specialization that should lead to compile failure. Those tests break down into a few categories: