Repository navigation
SignatureMismatch ICE #146965
Copy link
Copy link
Open
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-inliningArea: MIR inliningArea: MIR inliningA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Activity
- addedI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.C-bugCategory: This is a bug.Category: This is a bug.
on Sep 24, 2025 - addedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Sep 24, 2025 - addedregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
on Sep 24, 2025 - addedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Sep 24, 2025 bisection points to #142625
searched nightlies: from nightly-2025-06-23 to nightly-2025-09-24
regressed nightly: nightly-2025-06-29
searched commit range: bdaba05...11ad40b
regressed commit: 11ad40bcc @cjgillot
- addedP-highHigh priorityHigh priorityand removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Sep 24, 2025 This was previously reported at symbolica-dev/symbolica#33 but unfortunately not here.
- addedE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
on Sep 24, 2025 This crate is huge and hard to reduce, so I ran out of time. It's messy and can be reduced still, but I have something that's small enough for a test @cjgillot.
130-line repro
#[derive(Clone)] struct AlgebraicExtension<R> { _x: R, } impl<T> GaloisField for AlgebraicExtension<FiniteField<T>> where FiniteField<T>: Field, { type Base = FiniteField<T>; fn upgrade(&self) -> AlgebraicExtension<Self::Base> { fn is_irreducible<UField>(poly: &mut MultivariatePolynomial<FiniteField<UField>, u16>) where FiniteField<UField>: Field, { poly.bivariate_factorization(); poly.multivariate_factorization(); } let mut poly = MultivariatePolynomial::new(); is_irreducible(&mut poly); todo!() } } impl<R: Clone> Ring for AlgebraicExtension<R> { type Element = u16; } impl<R: Clone> EuclideanDomain for AlgebraicExtension<R> {} impl<R: Field> Field for AlgebraicExtension<R> {} trait GaloisField: Field { type Base: Field; fn upgrade(&self) -> AlgebraicExtension<Self::Base> { unimplemented!() } fn upgrade_element( &self, _: &Self::Element, ) -> <AlgebraicExtension<Self::Base> as Ring>::Element { unimplemented!() } } impl<UField> GaloisField for FiniteField<UField> where FiniteField<UField>: Field, { type Base = Self; } struct FiniteField<UField> { _m: UField, } trait Ring: Clone { type Element; } trait EuclideanDomain: Ring {} trait Field: EuclideanDomain {} impl<UField, F: GaloisField<Base = FiniteField<UField>>, E> MultivariatePolynomial<F, E> where FiniteField<UField>: Field, AlgebraicExtension<<F as GaloisField>::Base>: PolynomialGCD<E>, { fn bivariate_factorization(&self) { let _ = PolynomialGCD::gcd(self); let field = self.ring.upgrade(); let s_l = self.map_coeff(|c| self.ring.upgrade_element(c), field.clone()); s_l.bivariate_factorization(); } fn multivariate_factorization(&self) -> Vec<Self> { unimplemented!() } } trait PolynomialGCD<E>: Ring { fn gcd(_: &MultivariatePolynomial<Self, E>) -> MultivariatePolynomial<Self, E> { unimplemented!() } } impl<UField, F: GaloisField<Base = FiniteField<UField>>, E> PolynomialGCD<E> for F where FiniteField<UField>: Field, { fn gcd(a: &MultivariatePolynomial<Self, E>) -> MultivariatePolynomial<Self, E> { let field = a.ring.upgrade(); let ag = a.map_coeff(|c| a.ring.upgrade_element(c), field.clone()); let g = PolynomialGCD::gcd(&ag); g.map_coeff(|_| todo!(), a.ring.clone()) } } use std::marker::PhantomData; #[derive(Clone)] struct MultivariatePolynomial<F: Ring, E = u16> { ring: F, _phantom: PhantomData<(E, F)>, } impl<F: Ring, E> MultivariatePolynomial<F, E> { fn new() -> Self { unimplemented!() } } impl<F: Ring, E> MultivariatePolynomial<F, E> { fn map_coeff<U: Ring, T: Fn(&F::Element) -> U::Element>( &self, f: T, field: U, ) -> MultivariatePolynomial<U, E> { for m in self.into_iter() { f(m.coefficient); } MultivariatePolynomial { ring: todo!(), _phantom: PhantomData, } } } struct MonomialView<'a, F: 'a + Ring> { coefficient: &'a F::Element, } struct MonomialViewIterator<'a, F, E> { _m: &'a (F, E), } impl<'a, F: Ring, E> Iterator for MonomialViewIterator<'a, F, E> { type Item = MonomialView<'a, F>; fn next(&mut self) -> Option<Self::Item> { unimplemented!() } } impl<'a, F: Ring, E> IntoIterator for &'a MultivariatePolynomial<F, E> { type Item = MonomialView<'a, F>; type IntoIter = MonomialViewIterator<'a, F, E>; fn into_iter(self) -> Self::IntoIter { unimplemented!() } }
> CARGO_INCREMENTAL=0 RUSTFLAGS="-Zinline-mir -Zmir-opt-level=0" cargo build error: internal compiler error: compiler/rustc_traits/src/codegen.rs:45:13: Encountered error `SignatureMismatch(SignatureMismatchData { found_trait_ref: <{closure@src/lib.rs:82:21: 82:24} as std::ops::Fn<(&u16,)>>, expected_trait_ref: <{closure@src/lib.rs:82:21: 82:24} as std::ops::Fn<(&<AlgebraicExtension<FiniteField<UField>> as Ring>::Element,)>>, terr: Sorts(ExpectedFound { expected: Alias(Projection, AliasTy { args: [AlgebraicExtension<FiniteField<UField/#0>>], def_id: DefId(0:27 ~ symbolica[02ae]::Ring::Element), .. }), found: u16 }) })` selecting `<{closure@src/lib.rs:82:21: 82:24} as std::ops::Fn<(&<AlgebraicExtension<FiniteField<UField>> as Ring>::Element,)>>` during codegenReacted by Ben Ruijl12 remaining items
No, sorry, releasing assignment
- added a commit that references this issue
on Mar 3, 2026 @rustbot label +S-bug-has-test
- addedS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.
on Mar 13, 2026 root cause is #152409
- marked ICE in release builds from 1.90.0 onwards #150263 as a duplicate of this issue
on Oct 6, 2026 - added a commit that references this issue
on Oct 8, 2026
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-inliningArea: MIR inliningArea: MIR inliningA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Code
The crate
symbolicaversion 0.18.0 (https://crates.io/crates/symbolica) does not compile on stable Rust 1.90 in release mode.I will try to create a minimal example.
Meta
rustc --version --verbose:Error output
Backtrace