gtk-rs / gtk3-rs

Rust bindings for GTK 3
https://gtk-rs.org
MIT License
508 stars 90 forks source link

Update wayland-client version to 0.30 #801

Closed GuillaumeGomez closed 1 year ago

GuillaumeGomez commented 1 year ago

Fixes #800.

I might need your help @bilelmoussaoui, I currently have this error (multiple times):

error[E0599]: no method named `display` found for reference `&WaylandDevice` in the current scope
  --> gdkwayland/src/wayland_device.rs:35:28
   |
35 |         let display = self.display().downcast::<crate::WaylandDisplay>().unwrap();
   |                            ^^^^^^^ method not found in `&WaylandDevice`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `display`, perhaps you need to implement it:
           candidate #1: `AppLaunchContextExt`

But the objects inherit from others which do have this method, so I'm a bit lost. Any idea?

bilelmoussaoui commented 1 year ago

I believe the issue is you lack a use gdk::prelude::*;

GuillaumeGomez commented 1 year ago

@bilelmoussaoui I think I maybe forgot to add something in gdk since when I add the missing import we more or less have the same issue:

error[E0599]: the method `display` exists for reference `&WaylandDevice`, but its trait bounds were not satisfied
  --> gdkwayland/src/wayland_device.rs:36:28
   |
11 | / glib::wrapper! {
12 | |     #[doc(alias = "GdkWaylandDevice")]
13 | |     pub struct WaylandDevice(Object<ffi::GdkWaylandDevice>) @extends gdk::Device;
14 | |
...  |
17 | |     }
18 | | }
   | | -
   | | |
   | |_doesn't satisfy `WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
   |   doesn't satisfy `WaylandDevice: gdk::prelude::AppLaunchContextExt`
...
36 |           let display = self.display().downcast::<crate::WaylandDisplay>().unwrap();
   |                              ^^^^^^^ method cannot be called on `&WaylandDevice` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
           which is required by `WaylandDevice: gdk::prelude::AppLaunchContextExt`
           `&WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
           which is required by `&WaylandDevice: gdk::prelude::AppLaunchContextExt`
note: the trait `IsA` must be implemented
  --> /home/imperio/.cargo/git/checkouts/gtk-rs-core-7be42ca38bd6361c/e69aa51/glib/src/object.rs:65:1
   |
65 | / pub unsafe trait IsA<T: ObjectType>:
66 | |     ObjectType + Into<T> + AsRef<T> + std::borrow::Borrow<T>
   | |____________________________________________________________^

error[E0599]: the method `display` exists for reference `&WaylandDevice`, but its trait bounds were not satisfied
  --> gdkwayland/src/wayland_device.rs:53:28
   |
11 | / glib::wrapper! {
12 | |     #[doc(alias = "GdkWaylandDevice")]
13 | |     pub struct WaylandDevice(Object<ffi::GdkWaylandDevice>) @extends gdk::Device;
14 | |
...  |
17 | |     }
18 | | }
   | | -
   | | |
   | |_doesn't satisfy `WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
   |   doesn't satisfy `WaylandDevice: gdk::prelude::AppLaunchContextExt`
...
53 |           let display = self.display().downcast::<crate::WaylandDisplay>().unwrap();
   |                              ^^^^^^^ method cannot be called on `&WaylandDevice` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
           which is required by `WaylandDevice: gdk::prelude::AppLaunchContextExt`
           `&WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
           which is required by `&WaylandDevice: gdk::prelude::AppLaunchContextExt`
note: the trait `IsA` must be implemented
  --> /home/imperio/.cargo/git/checkouts/gtk-rs-core-7be42ca38bd6361c/e69aa51/glib/src/object.rs:65:1
   |
65 | / pub unsafe trait IsA<T: ObjectType>:
66 | |     ObjectType + Into<T> + AsRef<T> + std::borrow::Borrow<T>
   | |____________________________________________________________^

error[E0599]: the method `display` exists for reference `&WaylandDevice`, but its trait bounds were not satisfied
  --> gdkwayland/src/wayland_device.rs:71:28
   |
11 | / glib::wrapper! {
12 | |     #[doc(alias = "GdkWaylandDevice")]
13 | |     pub struct WaylandDevice(Object<ffi::GdkWaylandDevice>) @extends gdk::Device;
14 | |
...  |
17 | |     }
18 | | }
   | | -
   | | |
   | |_doesn't satisfy `WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
   |   doesn't satisfy `WaylandDevice: gdk::prelude::AppLaunchContextExt`
...
71 |           let display = self.display().downcast::<crate::WaylandDisplay>().unwrap();
   |                              ^^^^^^^ method cannot be called on `&WaylandDevice` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
           which is required by `WaylandDevice: gdk::prelude::AppLaunchContextExt`
           `&WaylandDevice: IsA<gdk::gio::AppLaunchContext>`
           which is required by `&WaylandDevice: gdk::prelude::AppLaunchContextExt`
note: the trait `IsA` must be implemented
  --> /home/imperio/.cargo/git/checkouts/gtk-rs-core-7be42ca38bd6361c/e69aa51/glib/src/object.rs:65:1
   |
65 | / pub unsafe trait IsA<T: ObjectType>:
66 | |     ObjectType + Into<T> + AsRef<T> + std::borrow::Borrow<T>
   | |____________________________________________________________^

error[E0599]: the method `display` exists for reference `&WaylandMonitor`, but its trait bounds were not satisfied
  --> gdkwayland/src/wayland_monitor.rs:23:28
   |
10 | / glib::wrapper! {
11 | |     #[doc(alias = "GdkWaylandMonitor")]
12 | |     pub struct WaylandMonitor(Object<ffi::GdkWaylandMonitor>) @extends gdk::Monitor;
13 | |
...  |
16 | |     }
17 | | }
   | | -
   | | |
   | |_doesn't satisfy `WaylandMonitor: IsA<gdk::gio::AppLaunchContext>`
   |   doesn't satisfy `WaylandMonitor: gdk::prelude::AppLaunchContextExt`
...
23 |           let display = self.display().downcast::<crate::WaylandDisplay>().unwrap();
   |                              ^^^^^^^ method cannot be called on `&WaylandMonitor` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `WaylandMonitor: IsA<gdk::gio::AppLaunchContext>`
           which is required by `WaylandMonitor: gdk::prelude::AppLaunchContextExt`
           `&WaylandMonitor: IsA<gdk::gio::AppLaunchContext>`
           which is required by `&WaylandMonitor: gdk::prelude::AppLaunchContextExt`
note: the trait `IsA` must be implemented
  --> /home/imperio/.cargo/git/checkouts/gtk-rs-core-7be42ca38bd6361c/e69aa51/glib/src/object.rs:65:1
   |
65 | / pub unsafe trait IsA<T: ObjectType>:
66 | |     ObjectType + Into<T> + AsRef<T> + std::borrow::Borrow<T>
   | |____________________________________________________________^

error[E0599]: the method `display` exists for reference `&WaylandSeat`, but its trait bounds were not satisfied
  --> gdkwayland/src/wayland_seat.rs:23:28
   |
10 | / glib::wrapper! {
11 | |     #[doc(alias = "GdkWaylandSeat")]
12 | |     pub struct WaylandSeat(Object<ffi::GdkWaylandSeat>) @extends gdk::Seat;
13 | |
...  |
16 | |     }
17 | | }
   | | -
   | | |
   | |_doesn't satisfy `WaylandSeat: IsA<gdk::gio::AppLaunchContext>`
   |   doesn't satisfy `WaylandSeat: gdk::prelude::AppLaunchContextExt`
...
23 |           let display = self.display().downcast::<crate::WaylandDisplay>().unwrap();
   |                              ^^^^^^^ method cannot be called on `&WaylandSeat` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `WaylandSeat: IsA<gdk::gio::AppLaunchContext>`
           which is required by `WaylandSeat: gdk::prelude::AppLaunchContextExt`
           `&WaylandSeat: IsA<gdk::gio::AppLaunchContext>`
           which is required by `&WaylandSeat: gdk::prelude::AppLaunchContextExt`
note: the trait `IsA` must be implemented
  --> /home/imperio/.cargo/git/checkouts/gtk-rs-core-7be42ca38bd6361c/e69aa51/glib/src/object.rs:65:1
   |
65 | / pub unsafe trait IsA<T: ObjectType>:
66 | |     ObjectType + Into<T> + AsRef<T> + std::borrow::Borrow<T>
   | |____________________________________________________________^

warning: unused import: `gdk::prelude`
 --> gdkwayland/src/wayland_device.rs:4:5
  |
4 | use gdk::prelude::*;
  |     ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `gdk::prelude`
 --> gdkwayland/src/wayland_monitor.rs:3:5
  |
3 | use gdk::prelude::*;
  |     ^^^^^^^^^^^^

warning: unused import: `gdk::prelude`
 --> gdkwayland/src/wayland_seat.rs:3:5
  |
3 | use gdk::prelude::*;
  |     ^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0599`.
warning: `gdkwayland` (lib) generated 3 warnings
error: could not compile `gdkwayland` due to 5 previous errors; 3 warnings emitted
GuillaumeGomez commented 1 year ago

Found the problem: some types were not marked as "non-final types" so I fixed it.

GuillaumeGomez commented 1 year ago

Updated!