error[E0308]: mismatched types. Expected struct `cairo_sys::cairo_t`, found struct `cairo_t`
I've just cloned the git repo and started to compile it when I got this error:
error[E0308]: mismatched types
--> /home/thomas/Projects/squeekboard/src/drawing.rs:84:57
|
84 | let cr = unsafe { cairo::Context::from_raw_none(cr) };
| ^^ expected struct `cairo_sys::cairo_t`, found struct `cairo_t`
|
= note: expected raw pointer `*mut cairo_sys::cairo_t`
found raw pointer `*mut cairo_t`
= note: perhaps two different versions of crate `cairo_sys` are being used?
error[E0308]: mismatched types
--> /home/thomas/Projects/squeekboard/src/drawing.rs:117:57
|
117 | let cr = unsafe { cairo::Context::from_raw_none(cr) };
| ^^ expected struct `cairo_sys::cairo_t`, found struct `cairo_t`
|
= note: expected raw pointer `*mut cairo_sys::cairo_t`
found raw pointer `*mut cairo_t`
= note: perhaps two different versions of crate `cairo_sys` are being used?
error[E0308]: mismatched types
--> /home/thomas/Projects/squeekboard/src/drawing.rs:208:17
|
208 | cairo::Context::to_raw_none(&cr),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `cairo_t`, found struct `cairo_sys::cairo_t`
|
= note: expected raw pointer `*mut cairo_t`
found raw pointer `*mut cairo_sys::cairo_t`
= note: perhaps two different versions of crate `cairo_sys` are being used?
error[E0277]: the trait bound `gtk::Widget: FromGlibPtrNone<*const GtkWidget>` is not satisfied
--> /home/thomas/Projects/squeekboard/src/drawing.rs:262:27
|
262 | let widget = unsafe { gtk::Widget::from_glib_none(keyboard.0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromGlibPtrNone<*const GtkWidget>` is not implemented for `gtk::Widget`
|
= help: the following implementations were found:
<gtk::Widget as FromGlibPtrNone<*const gtk_sys::GtkWidget>>
<gtk::Widget as FromGlibPtrNone<*mut gtk_sys::GtkWidget>>
error[E0277]: the trait bound `gtk::Widget: FromGlibPtrNone<*const GtkWidget>` is not satisfied
--> /home/thomas/Projects/squeekboard/src/popover.rs:249:27
|
249 | let window = unsafe { gtk::Widget::from_glib_none(window.0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromGlibPtrNone<*const GtkWidget>` is not implemented for `gtk::Widget`
|
= help: the following implementations were found:
<gtk::Widget as FromGlibPtrNone<*const gtk_sys::GtkWidget>>
<gtk::Widget as FromGlibPtrNone<*mut gtk_sys::GtkWidget>>
error[E0277]: the trait bound `CssProvider: ToGlibPtr<'_, *const GtkCssProvider>` is not satisfied
--> /home/thomas/Projects/squeekboard/src/style.rs:59:18
|
59 | provider.to_glib_full()
| ^^^^^^^^^^^^ the trait `ToGlibPtr<'_, *const GtkCssProvider>` is not implemented for `CssProvider`
|
= help: the following implementations were found:
<CssProvider as ToGlibPtr<'a, *const gtk_sys::GtkCssProvider>>
<CssProvider as ToGlibPtr<'a, *mut gtk_sys::GtkCssProvider>>
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `rs` due to 6 previous errors
Traceback (most recent call last):
File "/home/thomas/Projects/squeekboard/cargo_build.py", line 37, in <module>
subprocess.run(['sh', "{}/cargo.sh".format(source_dir.as_posix()), 'build']
File "/usr/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['sh', '/home/thomas/Projects/squeekboard/cargo.sh', 'build', '--lib']' returned non-zero exit status 101.
FAILED: src/librs.a
/usr/bin/python /home/thomas/Projects/squeekboard/cargo_build.py src/librs.a --lib
ninja: build stopped: subcommand failed.
I checked and I think I have all of the rust bindings installed.
OS: Arch Linux x86_64
Host: 81M9 Lenovo 300e 2nd Gen
Kernel: 5.16.0-arch1-1
CPU: Intel Celeron N4120 (4) @ 2.600GHz
You are welcome to ask for any more information if you need it.