55180d04f2
Projections can generate lifetime variables with equality constraints, that will not be resolved by `resolve_type_vars_if_possible`, so substs need to be lifetime-erased after that. Fixes #36848. |
||
---|---|---|
.. | ||
auxiliary | ||
README.md | ||
specialization-allowed-cross-crate.rs | ||
specialization-assoc-fns.rs | ||
specialization-basics.rs | ||
specialization-cross-crate-defaults.rs | ||
specialization-cross-crate-no-gate.rs | ||
specialization-cross-crate.rs | ||
specialization-default-methods.rs | ||
specialization-on-projection.rs | ||
specialization-out-of-order.rs | ||
specialization-overlap-projection.rs | ||
specialization-projection-alias.rs | ||
specialization-projection.rs | ||
specialization-super-traits.rs | ||
specialization-translate-projections-with-lifetimes.rs | ||
specialization-translate-projections-with-params.rs | ||
specialization-translate-projections.rs |
Tests that specialization is working correctly:
-
Dispatch
- On methods, includes:
- Specialization via adding a trait bound
- Including both remote and local traits
- Specialization via pure structure (e.g.
(T, U)
vs(T, T)
) - Specialization via concrete types vs unknown types
- In top level of the trait reference
- Embedded within another type (
Vec<T>
vsVec<i32>
)
- Specialization via adding a trait bound
- Specialization based on super trait relationships
- On assoc fns
- Ensure that impl order doesn't matter
- On methods, includes:
-
Item inheritance
- Correct default cascading for methods
- Inheritance works across impls with varying generics
-
Normalization issues
- Non-default assoc types can be projected
- Including non-specialized cases
- Including specialized cases
- Specialized Impls can happen on projections
- Projections and aliases play well together
- Projections involving specialization allowed in the trait ref for impls, and overlap can still be determined
- Only works for the simple case where the most specialized impl directly
provides a non-
default
associated type
- Only works for the simple case where the most specialized impl directly
provides a non-
- Non-default assoc types can be projected
-
Across crates
- For traits defined in upstream crate
- Full method dispatch tests, drawing from upstream crate
- Including additional local specializations
- Full method dispatch tests, without turning on specialization in local crate
- Test that defaults cascade correctly from upstream crates
- Including additional local use of defaults