rust/tests/ui/specialization
Noah Lev 37ed7a4438 Add ConstArgKind::Path and make ConstArg its own HIR node
This is a very large commit since a lot needs to be changed in order to
make the tests pass. The salient changes are:

- `ConstArgKind` gets a new `Path` variant, and all const params are now
  represented using it. Non-param paths still use `ConstArgKind::Anon`
  to prevent this change from getting too large, but they will soon use
  the `Path` variant too.

- `ConstArg` gets a distinct `hir_id` field and its own variant in
  `hir::Node`. This affected many parts of the compiler that expected
  the parent of an `AnonConst` to be the containing context (e.g., an
  array repeat expression). They have been changed to check the
  "grandparent" where necessary.

- Some `ast::AnonConst`s now have their `DefId`s created in
  rustc_ast_lowering rather than `DefCollector`. This is because in some
  cases they will end up becoming a `ConstArgKind::Path` instead, which
  has no `DefId`. We have to solve this in a hacky way where we guess
  whether the `AnonConst` could end up as a path const since we can't
  know for sure until after name resolution (`N` could refer to a free
  const or a nullary struct). If it has no chance as being a const
  param, then we create a `DefId` in `DefCollector` -- otherwise we
  decide during ast_lowering. This will have to be updated once all path
  consts use `ConstArgKind::Path`.

- We explicitly use `ConstArgHasType` for array lengths, rather than
  implicitly relying on anon const type feeding -- this is due to the
  addition of `ConstArgKind::Path`.

- Some tests have their outputs changed, but the changes are for the
  most part minor (including removing duplicate or almost-duplicate
  errors). One test now ICEs, but it is for an incomplete, unstable
  feature and is now tracked at #127009.
2024-07-16 19:27:28 -07:00
..
auxiliary Failing test 2024-06-07 14:59:38 -04:00
ctfe [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
defaultimpl Provide structured suggestion for #![feature(foo)] 2024-03-18 16:08:58 +00:00
min_specialization Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07: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
const_trait_impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const_trait_impl.stderr bless tests part 1 2024-06-28 10:57:35 +00: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 Show number in error message even for one error 2023-11-24 19:15:52 +01: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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
default-proj-ty-as-type-of-const-issue-125757.rs Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
default-proj-ty-as-type-of-const-issue-125757.stderr Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07: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 Show number in error message even for one error 2023-11-24 19:15:52 +01: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
issue-44861.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01: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 Provide structured suggestion for unconstrained generic constant 2024-03-21 00:03:59 +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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-63716-parse-async.stderr
issue-68830-spurious-diagnostics.rs Fail candidate assembly for erroneous types 2024-04-16 12:42:48 +05:30
issue-68830-spurious-diagnostics.stderr Fail candidate assembly for erroneous types 2024-04-16 12:42:48 +05:30
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 remove unnecessary attribute from a diagnostic 2023-05-05 17:28:52 +09:00
issue-111232.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
non-defaulted-item-fail.rs
non-defaulted-item-fail.stderr Fetch less HIR in signature check. 2023-02-14 20:26:03 +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 Stop using translate_args in the new solver 2024-05-31 09:42:30 -04: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.coherence.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
specialization-default-items-drop-coherence.next.stderr Fold item bound before checking that they hold 2024-05-30 15:52:29 -04:00
specialization-default-items-drop-coherence.rs Fold item bound before checking that they hold 2024-05-30 15:52:29 -04: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.rs
specialization-default-projection.stderr
specialization-default-types.rs
specialization-default-types.stderr Tweak expected message to explain what it's actually signifying 2023-09-23 00:57:17 +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 Fetch less HIR in signature check. 2023-02-14 20:26:03 +00:00
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
specialization-overlap-negative.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
specialization-overlap-projection.current.stderr fix NormalizesTo proof tree issue 2024-04-30 20:03:33 +00:00
specialization-overlap-projection.next.stderr Fold item bound before checking that they hold 2024-05-30 15:52:29 -04:00
specialization-overlap-projection.rs Fold item bound before checking that they hold 2024-05-30 15:52:29 -04: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
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: