Skip to content

Commit fbe1dc6

Browse files
Rollup merge of rust-lang#155865 - lcnr:add-test, r=lqd
add test for accidentally fixed `binius_field` issue cc rust-lang#153614 (comment) r? @lqd
2 parents 15a7cac + 23abf90 commit fbe1dc6

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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() {}

0 commit comments

Comments
 (0)