Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

builder: use undef bool instead of false, for checked_binop's zombie.#1025

Merged
eddyb merged 1 commit intoEmbarkStudios:mainfrom
LykenSol:checked-add-zombie-false
Apr 5, 2023
Merged

builder: use undef bool instead of false, for checked_binop's zombie.#1025
eddyb merged 1 commit intoEmbarkStudios:mainfrom
LykenSol:checked-add-zombie-false

Conversation

@eddyb
Copy link
Contributor

@eddyb eddyb commented Apr 4, 2023

The actual fix was tiny, but testing required going through some hoops, as the original issue only seemed to reproduce with --release (ironically, given the checked overflow connection).

In the end I went with -Ccodegen-units=1 (to try and force the user's bool constants to overlap the zombie), but I'm not 100% sure that's future-proof. But it did reproduce, i.e. w/o the fix, the test errors with:

error: checked add is not supported yet
   --> /home/eddy/.rustup/toolchains/nightly-2023-03-04-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/arith.rs:104:45
    |
104 |             fn add(self, other: $t) -> $t { self + other }
    |                                             ^^^^^^^^^^^^
    |
    = note: Stack:
            issue_1024::main
            main

@eddyb eddyb requested a review from oisyn as a code owner April 4, 2023 00:02
@eddyb eddyb enabled auto-merge (rebase) April 4, 2023 02:26
@eddyb eddyb merged commit 7b7015e into EmbarkStudios:main Apr 5, 2023
@eddyb eddyb deleted the checked-add-zombie-false branch April 5, 2023 11:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants