Add extra unchecked_disjoint_bitor implementations.#147368
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use |
|
@rustbot label +T-libs-api -T-libs r? libs-api |
This comment has been minimized.
This comment has been minimized.
943d050 to
845a872
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
r? libs-api |
This comment has been minimized.
This comment has been minimized.
845a872 to
39c4367
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
39c4367 to
ac624b5
Compare
This comment has been minimized.
This comment has been minimized.
ac624b5 to
41533fe
Compare
This comment has been minimized.
This comment has been minimized.
41533fe to
4f310fa
Compare
This comment has been minimized.
This comment has been minimized.
4f310fa to
c24ec23
Compare
There was a problem hiding this comment.
Seems reasonable to me but should get a @rust-lang/libs-api okay.
@rustbot label +I-libs-api-nominated
r? tgross35
| } | ||
|
|
||
| /// Same value as `self | other`, but UB if any bit position is set in both inputs. | ||
| /// Disjoint, bitwise or. Computes `self | rhs`, assuming no one bits in common. |
There was a problem hiding this comment.
"assuming no one bits in common" -> "assuming there are no one bits in common."
Or something like "Computes self | rhs given the precondition that no set bits of the inputs overlap."
| /// `((a as u32) << 16) | (b as u32)`, that's fine, as the backend will | ||
| /// know those sides of the `|` are disjoint without needing help. | ||
| /// Practically, this requires that `self | rhs`, `self ^ rhs`, and `self + rhs` all | ||
| /// yield the same result, allowing for any of the three to be emitted in code gen |
There was a problem hiding this comment.
Nit: "code gen" -> either "codegen" or "code generation"
There was a problem hiding this comment.
What is wrong with "code gen" ? It's already used in the repo: https://github.com/search?q=repo%3Arust-lang%2Frust%20%22code%20gen%22&type=code.
There was a problem hiding this comment.
Most of those hits are part of "code generation" https://github.com/search?q=repo%3Arust-lang%2Frust+%2Fcode+gen%5Cb%2F&type=code. Loosely I think "gen" is considered an abbreviation rather than a word that can stand on its own, but we do consider "codegen" to be one.
Also we have codegen-units, codegen-backend etc. rather than code-gen-units and code-gen-backend.
c24ec23 to
315ca01
Compare
…'i64', 'i128', and 'isize'; Update existing 'unchecked_disjoint_bitor' docs; Add 'must_use' to 'unchecked_disjoint_bitor';
315ca01 to
7d9b4e4
Compare

Tracking issue: #135758.
This PR implements the
unchecked_disjoint_bitormethod for additional types:Our
disjoint_bitorintrinsic is already implemented for these types. This method specifically is also already present on unsigned, integral types.Additionally, this PR rewrites the existing docs for
unchecked_disjoint_bitorand adds themust_useattribute to the method.