Skip to content

Use the unsigned integer types for bitwise intrinsics. - #13506

Closed
huonw wants to merge 1 commit into
rust-lang:masterfrom
huonw:bitwise-byte-intrinsics
Closed

Use the unsigned integer types for bitwise intrinsics.#13506
huonw wants to merge 1 commit into
rust-lang:masterfrom
huonw:bitwise-byte-intrinsics

Conversation

@huonw

Copy link
Copy Markdown
Contributor

Use the unsigned integer types for bitwise intrinsics.

Exposing ctpop, ctlz, cttz and bswap as taking signed i8/i16/... is just
exposing the internal LLVM names pointlessly (LLVM doesn't have "signed
integers" or "unsigned integers", it just has sized integer types
with (un)signed operations).

These operations are semantically working with raw bytes, which the
unsigned types model better.

Comment threadsrc/libstd/intrinsics.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could you add NOTE here to make this pop-up in make tidy ?

I use to grep for stage0 when doing a snapshot but it's still useful to use NOTE and make tidy

@alexcrichton

Copy link
Copy Markdown
Member

r=me, but it appears that there are failing tests on travis

Exposing ctpop, ctlz, cttz and bswap as taking signed i8/i16/... is just
exposing the internal LLVM names pointlessly (LLVM doesn't have "signed
integers" or "unsigned integers", it just has sized integer types
with (un)signed *operations*).
These operations are semantically working with raw bytes, which the
unsigned types model better.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 16, 2014
Closesrust-lang#13546 (workcache: Don't assume gcc exists on all platforms)
Closesrust-lang#13545 (std: Remove pub use globs)
Closesrust-lang#13530 (test: Un-ignore smallest-hello-world.rs)
Closesrust-lang#13529 (std: Un-ignore some float tests on windows)
Closesrust-lang#13528 (green: Add a helper macro for booting libgreen)
Closesrust-lang#13526 (Remove RUST_LOG="::help" from the docs)
Closesrust-lang#13524 (dist: Make Windows installer uninstall first. Closesrust-lang#9563)
Closesrust-lang#13521 (Change AUTHORS section in the man pages)
Closesrust-lang#13519 (Update GitHub's Rust projects page.)
Closesrust-lang#13518 (mk: Change windows to install from stage2)
Closesrust-lang#13516 (liburl doc: insert missing hyphen)
Closesrust-lang#13514 (rustdoc: Better sorting criteria for searching.)
Closesrust-lang#13512 (native: Fix a race in select())
Closesrust-lang#13506 (Use the unsigned integer types for bitwise intrinsics.)
Closesrust-lang#13502 (Add a default impl for Set::is_superset)
@huonw
huonw deleted the bitwise-byte-intrinsics branch July 11, 2014 05:54
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 18, 2024
…rednet
unused_result_ok: added in Clippy 1.82.0, not 1.70.0
changelog: none
Fixrust-lang#13497
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@huonw@alexcrichton@flaper87@bors