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

remove deprecated primitive type #636

Closed

Conversation

thorseraq
Copy link

@thorseraq thorseraq commented Oct 15, 2023

Since primitive types defined at https://github.com/rust-lang/rust/tree/4331c151b09a065f6b3bedf4158edc336317bc0d/library/core/src/num/shells are going to be deprecated and will be replaced by types defined at https://github.com/rust-lang/rust/blob/4331c151b09a065f6b3bedf4158edc336317bc0d/library/core/src/num/mod.rs which has been stable since 1.0.0, It seems a good time to update the corresponding implementations to align with these changes

@thorseraq thorseraq marked this pull request as draft October 15, 2023 15:33
@Darksonn
Copy link
Contributor

It seems like this is not possible on bytes's minimum supported rust version:

  error[E0599]: no associated item named `MAX` found for type `usize` in the current scope
     --> src/bytes_mut.rs:104:35
      |
  104 | const MAX_VEC_POS: usize = usize::MAX >> VEC_POS_OFFSET;
      |                                   ^^^ associated item not found in `usize`
  
  error[E0599]: no associated item named `MAX` found for type `isize` in the current scope
      --> src/buf/buf_mut.rs:1576:16
       |
  1576 |         isize::MAX as usize - self.len()
       |                ^^^ associated item not found in `isize`
  
  error[E0599]: no associated item named `MAX` found for type `usize` in the current scope
      --> src/bytes.rs:1108:26
       |
  1108 |     if old_size > usize::MAX >> 1 {
       |                          ^^^ associated item not found in `usize`
  
  error[E0599]: no associated item named `MAX` found for type `usize` in the current scope
      --> src/bytes_mut.rs:1085:16
       |
  1085 |         usize::MAX - self.len()
       |                ^^^ associated item not found in `usize`
  
  error[E0599]: no associated item named `MAX` found for type `isize` in the current scope
      --> src/bytes_mut.rs:1338:26
       |
  1338 |     if old_size > isize::MAX as usize {
       |                          ^^^ associated item not found in `isize`
  
  error: aborting due to 5 previous errors

@thorseraq
Copy link
Author

It seems like this is not possible on bytes's minimum supported rust version:

Sorry, yes: https://github.com/rust-lang/rust/blob/1.39.0/src/libcore/num/mod.rs, I'll close this :)

@thorseraq thorseraq closed this Oct 15, 2023
Sign up for free to 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.

2 participants