mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
37ed7a4438
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. |
||
---|---|---|
.. | ||
auxiliary | ||
ctfe | ||
defaultimpl | ||
min_specialization | ||
soundness | ||
anyid-repro-125197.rs | ||
assoc-ty-graph-cycle.rs | ||
assoc-ty-graph-cycle.stderr | ||
broken-mir-drop-glue-107228.rs | ||
const_trait_impl.rs | ||
const_trait_impl.stderr | ||
cross-crate-defaults.rs | ||
cross-crate-defaults.stderr | ||
default-associated-type-bound-1.rs | ||
default-associated-type-bound-1.stderr | ||
default-associated-type-bound-2.rs | ||
default-associated-type-bound-2.stderr | ||
default-generic-associated-type-bound.rs | ||
default-generic-associated-type-bound.stderr | ||
default-proj-ty-as-type-of-const-issue-125757.rs | ||
default-proj-ty-as-type-of-const-issue-125757.stderr | ||
dont-drop-upcast-candidate.rs | ||
dont-drop-upcast-candidate.stderr | ||
issue-33017.rs | ||
issue-33017.stderr | ||
issue-35376.rs | ||
issue-35376.stderr | ||
issue-36804.rs | ||
issue-36804.stderr | ||
issue-38091-2.rs | ||
issue-38091-2.stderr | ||
issue-38091.rs | ||
issue-38091.stderr | ||
issue-39448.rs | ||
issue-39448.stderr | ||
issue-39618.rs | ||
issue-39618.stderr | ||
issue-40582.rs | ||
issue-43037.current.stderr | ||
issue-43037.negative.stderr | ||
issue-43037.rs | ||
issue-44861.rs | ||
issue-44861.stderr | ||
issue-45814.current.stderr | ||
issue-45814.negative.stderr | ||
issue-45814.rs | ||
issue-50452-fail.rs | ||
issue-50452-fail.stderr | ||
issue-50452.rs | ||
issue-50452.stderr | ||
issue-51892.rs | ||
issue-51892.stderr | ||
issue-52050.rs | ||
issue-52050.stderr | ||
issue-59435.rs | ||
issue-59435.stderr | ||
issue-63716-parse-async.rs | ||
issue-63716-parse-async.stderr | ||
issue-68830-spurious-diagnostics.rs | ||
issue-68830-spurious-diagnostics.stderr | ||
issue-70442.rs | ||
issue-70442.stderr | ||
issue-111232.rs | ||
issue-111232.stderr | ||
non-defaulted-item-fail.rs | ||
non-defaulted-item-fail.stderr | ||
README-rpass.md | ||
README.md | ||
source-impl-requires-constraining-predicates-ambig.next.stderr | ||
source-impl-requires-constraining-predicates-ambig.rs | ||
source-impl-requires-constraining-predicates.current.stderr | ||
source-impl-requires-constraining-predicates.next.stderr | ||
source-impl-requires-constraining-predicates.rs | ||
specialization-allowed-cross-crate.rs | ||
specialization-allowed-cross-crate.stderr | ||
specialization-assoc-fns.rs | ||
specialization-assoc-fns.stderr | ||
specialization-basics.rs | ||
specialization-basics.stderr | ||
specialization-cross-crate-no-gate.rs | ||
specialization-cross-crate.rs | ||
specialization-cross-crate.stderr | ||
specialization-default-items-drop-coherence.coherence.stderr | ||
specialization-default-items-drop-coherence.next.stderr | ||
specialization-default-items-drop-coherence.rs | ||
specialization-default-methods.rs | ||
specialization-default-methods.stderr | ||
specialization-default-projection.rs | ||
specialization-default-projection.stderr | ||
specialization-default-types.rs | ||
specialization-default-types.stderr | ||
specialization-feature-gate-default.rs | ||
specialization-feature-gate-default.stderr | ||
specialization-feature-gate-overlap.rs | ||
specialization-feature-gate-overlap.stderr | ||
specialization-no-default.rs | ||
specialization-no-default.stderr | ||
specialization-on-projection.rs | ||
specialization-on-projection.stderr | ||
specialization-out-of-order.rs | ||
specialization-out-of-order.stderr | ||
specialization-overlap-hygiene.rs | ||
specialization-overlap-hygiene.stderr | ||
specialization-overlap-negative.rs | ||
specialization-overlap-negative.stderr | ||
specialization-overlap-projection.current.stderr | ||
specialization-overlap-projection.next.stderr | ||
specialization-overlap-projection.rs | ||
specialization-overlap.rs | ||
specialization-overlap.stderr | ||
specialization-polarity.rs | ||
specialization-polarity.stderr | ||
specialization-projection-alias.rs | ||
specialization-projection-alias.stderr | ||
specialization-projection.rs | ||
specialization-projection.stderr | ||
specialization-supertraits.rs | ||
specialization-supertraits.stderr | ||
specialization-translate-projections-with-lifetimes.rs | ||
specialization-translate-projections-with-lifetimes.stderr | ||
specialization-translate-projections-with-params.rs | ||
specialization-translate-projections-with-params.stderr | ||
specialization-translate-projections.rs | ||
specialization-translate-projections.stderr | ||
transmute-specialization.rs | ||
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:
-
Feature gating
-
Overlap checking with specialization enabled
- Basic overlap scenarios
- Includes purely structural overlap
- Includes purely trait-based overlap
- Includes mix
- Overlap with differing polarity
- Basic overlap scenarios
-
Attempt to rely on projection of a
default
type