Skip to content

error[E0308]: mismatched types when building for android #433

@ShootingKing-AM

Description

@ShootingKing-AM
  • Succeeds with Building arm64-v8a (aarch64-linux-android) and Building x86_64 (x86_64-linux-android)
  • Building x86 (i686-linux-android)
   --> C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\socket2-0.5.2\src\sys\unix.rs:694:31
    |
694 |                 self.len() == offset_of_path(storage) as u32
    |                 ----------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |                 |
    |                 expected because this is `i32`
    |
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
694 |                 self.len() == (offset_of_path(storage) as u32).try_into().unwrap()
    |                               +                              +++++++++++++++++++++

error[E0308]: mismatched types
   --> C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\socket2-0.5.2\src\sys\unix.rs:757:27
    |
757 |             (self.len() > offset_of_path(storage) as u32 && storage.sun_path[0] != 0).then(|| {
    |              ----------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |              |
    |              expected because this is `i32`
    |
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
757 |             (self.len() > (offset_of_path(storage) as u32).try_into().unwrap() && storage.sun_path[0] != 0).then(|| {
    |                           +                              +++++++++++++++++++++

error[E0308]: mismatched types
   --> C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\socket2-0.5.2\src\sys\unix.rs:775:31
    |
775 |                 (self.len() > offset_of_path(storage) as u32 && storage.sun_path[0] == 0)
    |                  ----------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |                  |
    |                  expected because this is `i32`
    |
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
775 |                 (self.len() > (offset_of_path(storage) as u32).try_into().unwrap() && storage.sun_path[0] == 0)
    |                               +                              +++++++++++++++++++++
  • Building armeabi-v7a (armv7-linux-androideabi)
error[E0308]: mismatched types
   --> C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\socket2-0.5.2\src\sys\unix.rs:694:31
    |
694 |                 self.len() == offset_of_path(storage) as u32
    |                 ----------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |                 |

help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
694 |                 self.len() == (offset_of_path(storage) as u32).try_into().unwrap()
    |                               +                              +++++++++++++++++++++

error[E0308]: mismatched types
   --> C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\socket2-0.5.2\src\sys\unix.rs:757:27
    |
757 |             (self.len() > offset_of_path(storage) as u32 && storage.sun_path[0] != 0).then(|| {
    |              ----------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |              |
    |              expected because this is `i32`
    |
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
757 |             (self.len() > (offset_of_path(storage) as u32).try_into().unwrap() && storage.sun_path[0] != 0).then(|| {
    |                           +                              +++++++++++++++++++++

error[E0308]: mismatched types
   --> C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\socket2-0.5.2\src\sys\unix.rs:775:31
    |
775 |                 (self.len() > offset_of_path(storage) as u32 && storage.sun_path[0] == 0)
    |                  ----------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |                  |
    |                  expected because this is `i32`
    |
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
775 |                 (self.len() > (offset_of_path(storage) as u32).try_into().unwrap() && storage.sun_path[0] == 0)
    |                               +                              +++++++++++++++++++++

ps: ref https://developer.android.com/ndk/guides/abis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions