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

Provide support for least and fast integer types #1838

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/fixed_width_ints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ pub type uint16_t = u16;
pub type uint32_t = u32;
#[deprecated(since = "0.2.55", note = "Use u64 instead.")]
pub type uint64_t = u64;

pub type int_least8_t = i8;
pub type int_least16_t = i16;
pub type int_least32_t = i32;
pub type int_least64_t = i64;
pub type uint_least8_t = u8;
pub type uint_least16_t = u16;
pub type uint_least32_t = u32;
pub type uint_least64_t = u64;
Comment on lines +22 to +29
Copy link
Member

@JohnTitor JohnTitor Jul 25, 2020

Choose a reason for hiding this comment

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

This should be in platfrom-dependent module e.g. unix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it makes sense to duplicate it in platform-dependent modules because:

  • It is the same for every supported target.
  • The typedef being different than what is above would mean that some primitive type isn't available at all on a platform, which is very unlikely if ever it exists.
  • If such a platform existed, it would be really unlikely to be targeted by Rust, as not beign able to use e.g. u8 would be very hard to handle.
  • In any case it can always be moved later if ever a platform need other typedefs

Copy link
Member

@JohnTitor JohnTitor Jul 25, 2020

Choose a reason for hiding this comment

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

Hm, then I don't think we need them with the same reason as #1304.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexcrichton said it was awaiting an implementation, but I'm fine with whatever decision is taken