Skip to content
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

Spurious "checked add" errors from false constants, since nightly-2023-03-04. #1024

Closed
eddyb opened this issue Apr 3, 2023 · 0 comments · Fixed by #1025
Closed

Spurious "checked add" errors from false constants, since nightly-2023-03-04. #1024

eddyb opened this issue Apr 3, 2023 · 0 comments · Fixed by #1025
Labels
t: bug Something isn't working

Comments

@eddyb
Copy link
Contributor

eddyb commented Apr 3, 2023

In this most recent nightly update:

We were hit by the fact that e.g. <u32 as Add>::add now invokes checked_binop(Add) (i.e. the codegen backend equivalent of u32::overflowing_add), ignoring the bool "did it overflow?" flag only in the MIR Assert for overflow checks.

The fix seemed to work, but it's fundamentally flawed because of using Add (or Sub or Mul) and the constant false anywhere in the same crate (well, codegen unit to be more precise, so this is a bit tricky to trigger), will cause the OpConstantFalse instruction used by both to be annotated with the checked add is not supported yet.

cc @Shfty (who ran into this in their project, that also triggered #1021, after switching to Rust-GPU main)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant