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

Fails to build with swipl v8.2 #43

Open
matko opened this issue Jan 20, 2023 · 0 comments
Open

Fails to build with swipl v8.2 #43

matko opened this issue Jan 20, 2023 · 0 comments

Comments

@matko
Copy link
Collaborator

matko commented Jan 20, 2023

swipl 8.2 apparently has slightly different types, leading to build failures in stream:

$ swivm use v8.2.0
Now using SWI-Prolog v8.2.0
$ cargo build --all-features
...
error[E0308]: mismatched types
  --> swipl/src/stream.rs:78:26
   |
78 |     if (*stream).flags & fli::SIO_OUTPUT == 0 {
   |                          ^^^^^^^^^^^^^^^ expected `i32`, found `u32`

error[E0277]: no implementation for `i32 & u32`
  --> swipl/src/stream.rs:78:24
   |
78 |     if (*stream).flags & fli::SIO_OUTPUT == 0 {
   |                        ^ no implementation for `i32 & u32`
   |
   = help: the trait `BitAnd<u32>` is not implemented for `i32`
   = help: the following other types implement trait `BitAnd<Rhs>`:
             <&'a i128 as BitAnd<i128>>
             <&'a i16 as BitAnd<i16>>
             <&'a i32 as BitAnd<i32>>
             <&'a i64 as BitAnd<i64>>
             <&'a i8 as BitAnd<i8>>
             <&'a isize as BitAnd<isize>>
             <&'a u128 as BitAnd<u128>>
             <&'a u16 as BitAnd<u16>>
           and 40 others

error[E0308]: mismatched types
   --> swipl/src/stream.rs:220:26
    |
220 |     if (*stream).flags & fli::SIO_INPUT == 0 {
    |                          ^^^^^^^^^^^^^^ expected `i32`, found `u32`

error[E0277]: no implementation for `i32 & u32`
   --> swipl/src/stream.rs:220:24
    |
220 |     if (*stream).flags & fli::SIO_INPUT == 0 {
    |                        ^ no implementation for `i32 & u32`
    |
    = help: the trait `BitAnd<u32>` is not implemented for `i32`
    = help: the following other types implement trait `BitAnd<Rhs>`:
              <&'a i128 as BitAnd<i128>>
              <&'a i16 as BitAnd<i16>>
              <&'a i32 as BitAnd<i32>>
              <&'a i64 as BitAnd<i64>>
              <&'a i8 as BitAnd<i8>>
              <&'a isize as BitAnd<isize>>
              <&'a u128 as BitAnd<u128>>
              <&'a u16 as BitAnd<u16>>
            and 40 others

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `swipl` due to 4 previous errors
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

No branches or pull requests

1 participant