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

expected 'bool', found integer - Mac M1 Chip #2139

Closed
Logenleedev opened this issue Jan 6, 2022 · 8 comments
Closed

expected 'bool', found integer - Mac M1 Chip #2139

Logenleedev opened this issue Jan 6, 2022 · 8 comments

Comments

@Logenleedev
Copy link

Logenleedev commented Jan 6, 2022

I notice that some people reported this error before as it is induced by some older winit version. I included "winit = "0.26.1" in my Cargo.toml file and I also run cargo update, but I am not sure why I still see this error.

Compiling winit v0.19.5
error[E0308]: mismatched types
   --> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/view.rs:209:9
    |
205 | extern fn has_marked_text(this: &Object, _sel: Sel) -> BOOL {
    |                                                        ---- expected `bool` because of return type
...
209 |         (marked_text.length() > 0) as i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `i8`

error[E0308]: mismatched types
   --> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:103:26
    |
103 |             is_zoomed != 0
    |                          ^ expected `bool`, found integer

error[E0308]: mismatched types
   --> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:175:57
    |
175 |                 self.window.setFrame_display_(new_rect, 0);
    |                                                         ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1301:48
     |
1301 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1308:48
     |
1308 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1325:48
     |
1325 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1332:48
     |
1332 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

For more information about this error, try `rustc --explain E0308`.
error: could not compile `winit` due to 7 previous errors

I go to the registry/src/github.com-1ecc6299db9ec823 folder and I saw three versions of winit

winit-0.19.5
matrixmultiply-0.2.4			winit-0.24.0
memchr-2.4.1				winit-0.26.1

So my guess is this is some referencing issue

@madsmtm
Copy link
Member

madsmtm commented Jan 6, 2022

Caused by #2119, we were probably mistaken to revert all of it (it also has quite a large UB issue, see #2138).

Apologies for the inconvenience, I'm going to bed around now but will do a PR to fix it tomorrow (unless @ArturKovacs does it first).

@Logenleedev
Copy link
Author

Thank you so much for the clarification!

@aloucks
Copy link
Contributor

aloucks commented Jan 7, 2022

The error message indicates that you're using a very old version of winit: winit-0.19.5

/Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/view.rs:209:9

@Logenleedev
Copy link
Author

Logenleedev commented Jan 7, 2022

But i downloaded the newer version and include the current version in my cargo.toml file, is there a way to change the default reference?

@madsmtm
Copy link
Member

madsmtm commented Jan 7, 2022

Yeah, on second look I was mistaken, the linked PR is not the issue, you're somehow using a very old winit version.

Could you post your Cargo.lock, that might contain information on why this version is being used? Alternatively, try searching for winit in there, that might reveal a dependency that uses winit 0.19.5.

@Logenleedev
Copy link
Author

There are two places in lock file which include winit 0.19.5

[[package]]
name = "winit"
version = "0.19.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e96eb4bb472fa43e718e8fa4aef82f86cd9deac9483a1e1529230babdb394a8"
dependencies = [
 "android_glue",
 "backtrace",
 "bitflags",
 "cocoa 0.18.5",
 "core-foundation 0.6.4",
 "core-graphics 0.17.3",
 "lazy_static",
 "libc",
 "log",
 "objc",
 "parking_lot 0.9.0",
 "percent-encoding",
 "raw-window-handle 0.3.4",
 "smithay-client-toolkit 0.4.6",
 "wayland-client 0.21.13",
 "winapi",
 "x11-dl",
]

and

[[package]]
name = "glutin"
version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5371b35b309dace06be1b81b5f6adb1c9de578b7dbe1e74bf7e4ef762cf6febd"
dependencies = [
 "android_glue",
 "cgl 0.2.3",
 "cocoa 0.18.5",
 "core-foundation 0.6.4",
 "core-graphics 0.17.3",
 "glutin_egl_sys",
 "glutin_emscripten_sys",
 "glutin_gles2_sys",
 "glutin_glx_sys",
 "glutin_wgl_sys",
 "lazy_static",
 "libloading 0.5.2",
 "objc",
 "osmesa-sys",
 "parking_lot 0.9.0",
 "wayland-client 0.21.13",
 "winapi",
 "winit 0.19.5",
]

@madsmtm
Copy link
Member

madsmtm commented Jan 7, 2022

Well, onwards we go; which package is including the old glutin version (glutin is currently at v0.28.0)?

@Logenleedev
Copy link
Author

Thanks! I think I figured it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants