Skip to content

typenum Div results in overflow #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lcnr opened this issue Apr 23, 2025 · 0 comments
Closed

typenum Div results in overflow #184

lcnr opened this issue Apr 23, 2025 · 0 comments
Assignees
Labels
from-crater A regression found via a crater run, not part of our test suite

Comments

@lcnr
Copy link
Contributor

lcnr commented Apr 23, 2025

use typenum::{consts::*, Div};
fn is_div<T: Div<U>, U>() {}
fn main() {
    is_div::<U2, U1>();
}

fails with unavoidable overflow errors in the new solver

@lcnr lcnr changed the title typenum PartialDiv results in overflow typenum Div results in overflow Apr 23, 2025
@lcnr lcnr moved this from unknown to in progress in -Znext-solver=globally Apr 24, 2025
@lcnr lcnr self-assigned this Apr 24, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 25, 2025
…er-errors

norm nested aliases before evaluating the parent goal

see the explanation of the underlying issue in tests/ui/traits/next-solver/normalize/eager-norm-pre-normalizes-to.rs.

This is also the cause of rust-lang/trait-system-refactor-initiative#184, fixing the overflow errors with the new solver. I did not add any tests based on it directly as relying on that behavior to cause recursion limit shenanigans feels fragile. Thanks `@Nadrieril` for minimizing the issue [on zulip](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/typenum.20.602.20.2F.201.60.20overflow.20error/with/513993621).

r? `@compiler-errors`
@lcnr lcnr added the from-crater A regression found via a crater run, not part of our test suite label Apr 25, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 25, 2025
Rollup merge of rust-lang#140236 - lcnr:normalizes-to-goals, r=compiler-errors

norm nested aliases before evaluating the parent goal

see the explanation of the underlying issue in tests/ui/traits/next-solver/normalize/eager-norm-pre-normalizes-to.rs.

This is also the cause of rust-lang/trait-system-refactor-initiative#184, fixing the overflow errors with the new solver. I did not add any tests based on it directly as relying on that behavior to cause recursion limit shenanigans feels fragile. Thanks `@Nadrieril` for minimizing the issue [on zulip](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/typenum.20.602.20.2F.201.60.20overflow.20error/with/513993621).

r? `@compiler-errors`
@lcnr lcnr moved this from in progress to done in -Znext-solver=globally Apr 25, 2025
@lcnr lcnr closed this as completed by moving to done in -Znext-solver=globally Apr 25, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Apr 26, 2025
norm nested aliases before evaluating the parent goal

see the explanation of the underlying issue in tests/ui/traits/next-solver/normalize/eager-norm-pre-normalizes-to.rs.

This is also the cause of rust-lang/trait-system-refactor-initiative#184, fixing the overflow errors with the new solver. I did not add any tests based on it directly as relying on that behavior to cause recursion limit shenanigans feels fragile. Thanks `@Nadrieril` for minimizing the issue [on zulip](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/typenum.20.602.20.2F.201.60.20overflow.20error/with/513993621).

r? `@compiler-errors`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from-crater A regression found via a crater run, not part of our test suite
Projects
Development

No branches or pull requests

1 participant