method `render_texture` exists for enum `Option<Renderer>`, but its trait bounds were not satisfied
I was trying to build Obfuscate 0.0.10 for Ubuntu 24.04 LTS but the build fails. The build succeeds on Debian Experimental which I believe is a fairly similar environment.
Build log excerpt
Compiling obfuscate v0.0.10 (/<<PKGBUILDDIR>>)
error[E0599]: the method `render_texture` exists for enum `Option<Renderer>`, but its trait bounds were not satisfied
--> src/widgets/drawing_area.rs:616:32
|
616 | let texture = renderer.render_texture(&node, None);
| ^^^^^^^^^^^^^^ method cannot be called on `Option<Renderer>` due to unsatisfied trait bounds
--> /build/rustc-Px5Ywq/rustc-1.75.0+dfsg0ubuntu1/library/core/src/option.rs:569:1
|
= note: doesn't satisfy `_: GskRendererExt`
|
= note: doesn't satisfy `_: IsA<Renderer>`
|
= note: the following trait bounds were not satisfied:
`std::option::Option<gtk4::gsk4::Renderer>: IsA<gtk4::gsk4::Renderer>`
which is required by `std::option::Option<gtk4::gsk4::Renderer>: gtk4::prelude::GskRendererExt`
note: the method `render_texture` exists on the type `gtk4::gsk4::Renderer`
--> /usr/share/cargo/registry/gsk4-0.8.1/src/auto/renderer.rs:83:5
|
83 | fn render_texture(&self, root: impl AsRef<RenderNode>, viewport: Option<&graphene::Rect>) -> gdk::Texture {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider using `Option::expect` to unwrap the `gtk4::gsk4::Renderer` value, panicking if the value is an `Option::None`
|
616 | let texture = renderer.expect("REASON").render_texture(&node, None);
| +++++++++++++++++
For more information about this error, try `rustc --explain E0599`.
Full build log
https://launchpad.net/ubuntu/+source/obfuscate/0.0.10-1/+latestbuild/amd64
To compare with Debian, click Installed at https://buildd.debian.org/status/package.php?p=obfuscate&suite=experimental
cc/ @werdahias