File tree Expand file tree Collapse file tree
tests/ui/traits/next-solver/normalization-shadowing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //@ revisions: current next
2+ //@ ignore-compare-mode-next-solver (explicit revisions)
3+ //@[next] compile-flags: -Znext-solver
4+ //@ check-pass
5+
6+ // One of the minimizations from trait-system-refactor-initiative#257 which ended up
7+ // getting fixed by #153614. It seems somewhat likely that this is somewhat
8+ // accidental by changing the exact shape of the cycle, causing us to avoid the
9+ // underlying issue of trait-system-refactor-initiative#257.
10+
11+ pub trait Field : Sized + HasUnderlier < Underlier : PackScalar < Self > > { }
12+ pub trait PackScalar < F > : ' static + UnderlierType {
13+ type Packed ;
14+ }
15+ trait PackedField {
16+ type Scalar ;
17+ }
18+ pub trait UnderlierType { }
19+ pub trait HasUnderlier {
20+ type Underlier ;
21+ }
22+ impl < U : UnderlierType > HasUnderlier for U {
23+ type Underlier = U ;
24+ }
25+ impl UnderlierType for u8 { }
26+ struct MyField ;
27+ impl Field for MyField { }
28+ impl HasUnderlier for MyField {
29+ type Underlier = u8 ;
30+ }
31+ impl < F > PackScalar < F > for u8
32+ where
33+ F : Field ,
34+ {
35+ type Packed = PackedPrimitiveType < F > ;
36+ }
37+ pub struct PackedPrimitiveType < Scalar : Field > ( Scalar ) ;
38+ impl < Scalar > PackedField for PackedPrimitiveType < Scalar >
39+ where
40+ Scalar : Field ,
41+ {
42+ type Scalar = Scalar ;
43+ }
44+
45+ pub trait PackedTransformationFactory < OP > { }
46+ trait TaggedPackedTransformationFactory < OP > : PackedField < Scalar : Field > { }
47+ impl < OP > PackedTransformationFactory < OP > for PackedPrimitiveType < MyField > where
48+ Self : TaggedPackedTransformationFactory < OP >
49+ {
50+ }
51+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments