From 23abf90ff8a0ad5aeae6ea5f344338ab9af97485 Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 27 Apr 2026 10:05:57 +0200 Subject: [PATCH] add test --- .../is-global-norm-binius_field-regression.rs | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/ui/traits/next-solver/normalization-shadowing/is-global-norm-binius_field-regression.rs diff --git a/tests/ui/traits/next-solver/normalization-shadowing/is-global-norm-binius_field-regression.rs b/tests/ui/traits/next-solver/normalization-shadowing/is-global-norm-binius_field-regression.rs new file mode 100644 index 0000000000000..bcf3867b65f7c --- /dev/null +++ b/tests/ui/traits/next-solver/normalization-shadowing/is-global-norm-binius_field-regression.rs @@ -0,0 +1,51 @@ +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@ check-pass + +// One of the minimizations from trait-system-refactor-initiative#257 which ended up +// getting fixed by #153614. It seems somewhat likely that this is somewhat +// accidental by changing the exact shape of the cycle, causing us to avoid the +// underlying issue of trait-system-refactor-initiative#257. + +pub trait Field: Sized + HasUnderlier> {} +pub trait PackScalar: 'static + UnderlierType { + type Packed; +} +trait PackedField { + type Scalar; +} +pub trait UnderlierType {} +pub trait HasUnderlier { + type Underlier; +} +impl HasUnderlier for U { + type Underlier = U; +} +impl UnderlierType for u8 {} +struct MyField; +impl Field for MyField {} +impl HasUnderlier for MyField { + type Underlier = u8; +} +impl PackScalar for u8 +where + F: Field, +{ + type Packed = PackedPrimitiveType; +} +pub struct PackedPrimitiveType(Scalar); +impl PackedField for PackedPrimitiveType +where + Scalar: Field, +{ + type Scalar = Scalar; +} + +pub trait PackedTransformationFactory {} +trait TaggedPackedTransformationFactory: PackedField {} +impl PackedTransformationFactory for PackedPrimitiveType where + Self: TaggedPackedTransformationFactory +{ +} +fn main() {}