HaoYang670 opened a new pull request, #1823:
URL: https://github.com/apache/arrow-rs/pull/1823

   Signed-off-by: remzi <[email protected]>
   
   This is a follow-up PR of #1819.
   
   # Rationale for this change
    `OffsetSizeTrait` should only be implemented for `i32` and `i64`
   
   # What changes are included in this PR?
   1. seal the `OffsetSizeTrait`
   2. update docs
   
   # Are there any user-facing changes?
   Yes.
   
   ## verify
   
   ```rust
   impl OffsetSizeTrait for u32 {
       const IS_LARGE: bool = false;
   }
   ```
   gives compile error
   ```
   error[E0277]: the trait bound `u32: array_list::private::Sealed` is not 
satisfied
     --> arrow/src/array/array_list.rs:49:6
      |
   49 | impl OffsetSizeTrait for u32 {
      |      ^^^^^^^^^^^^^^^ the trait `array_list::private::Sealed` is not 
implemented for `u32`
      |
      = help: the following implementations were found:
                <i32 as array_list::private::Sealed>
                <i64 as array_list::private::Sealed>
   note: required by a bound in `array_list::OffsetSizeTrait`
     --> arrow/src/array/array_list.rs:36:55
      |
   35 | pub trait OffsetSizeTrait:
      |           --------------- required by a bound in this
   36 |     ArrowNativeType + std::ops::AddAssign + Integer + private::Sealed
      |                                                       ^^^^^^^^^^^^^^^ 
required by this bound in `array_list::OffsetSizeTrait`
   ```
   , which is good!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to