Allow using X11 / Wayland on platforms that have another standard backend (macOS, Android)
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- android, linux, macos, rust
调研方向
复现报告的 cargo build --target x86_64-linux-android 失败,然后检查 src/lib.rs、src/backend_dispatch.rs 和 src/backend_interface.rs,尤其是泛型后端分派和 handle 的约束。相关 target 能够在不出现报告中的泛型参数和类型推断错误的情况下完成构建,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Partially related to #44 I am trying to compile some rust application targeting termux (x11) and am getting the below errors. I have tried both compiling within termux, as well as on my desktop
command: cargo build --target x86_64-linux-android
Error log
error[E0392]: parameter `D` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:33:20
|
33 | pub struct Context<D> {
| ^ unused parameter
|
= help: consider removing `D`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `D` to be a const parameter, use `const D: usize` instead
error[E0392]: parameter `D` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:74:20
|
74 | pub struct Surface<D, W> {
| ^ unused parameter
|
= help: consider removing `D`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `D` to be a const parameter, use `const D: usize` instead
error[E0392]: parameter `W` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:74:23
|
74 | pub struct Surface<D, W> {
| ^ unused parameter
|
= help: consider removing `W`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `W` to be a const parameter, use `const W: usize` instead
error[E0392]: parameter `'a` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:197:19
|
197 | pub struct Buffer<'a, D, W> {
| ^^ unused parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
error[E0392]: parameter `D` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:197:23
|
197 | pub struct Buffer<'a, D, W> {
| ^ unused parameter
|
= help: consider removing `D`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `D` to be a const parameter, use `const D: usize` instead
error[E0392]: parameter `W` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:197:26
|
197 | pub struct Buffer<'a, D, W> {
| ^ unused parameter
|
= help: consider removing `W`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `W` to be a const parameter, use `const W: usize` instead
error[E0392]: parameter `D` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/backend_dispatch.rs:180:6
|
180 | <D, W> =>
| ^ unused parameter
|
= help: consider removing `D`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `D` to be a const parameter, use `const D: usize` instead
error[E0392]: parameter `W` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/backend_dispatch.rs:180:9
|
180 | <D, W> =>
| ^ unused parameter
|
= help: consider removing `W`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `W` to be a const parameter, use `const W: usize` instead
error[E0392]: parameter `'a` is never used
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/backend_dispatch.rs:119:40
|
119 | pub(crate) enum BufferDispatch<'a, $dgen, $wgen> {
| ^^ unused parameter
...
179 | / make_dispatch! {
180 | | <D, W> =>
181 | | #[cfg(x11_platform)]
182 | | X11(Rc<backends::x11::X11DisplayImpl<D>>, backends::x11::X11Impl<D, W>, backends::x11::BufferImpl<'a, D, W>),
... |
194 | | Orbital(D, backends::orbital::OrbitalImpl<D, W>, backends::orbital::BufferImpl<'a, D, W>),
195 | | }
| |_- in this macro invocation
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
= note: this error originates in the macro `make_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0283]: type annotations needed
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:83:15
|
83 | match SurfaceDispatch::new(window, &context.context_impl) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `D` declared on the trait `SurfaceInterface`
|
= note: cannot satisfy `_: HasDisplayHandle`
= help: the following types implement trait `HasDisplayHandle`:
NoDisplayHandle
Box<H>
DisplayHandle<'a>
Rc<H>
Arc<H>
&H
&mut H
note: required by a bound in `backend_interface::SurfaceInterface::new`
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/backend_interface.rs:15:38
|
15 | pub(crate) trait SurfaceInterface<D: HasDisplayHandle + ?Sized, W: HasWindowHandle + ?Sized> {
| ^^^^^^^^^^^^^^^^ required by this bound in `SurfaceInterface::new`
...
21 | fn new(window: W, context: &Self::Context) -> Result<Self, InitError<W>>
| --- required by a bound in this associated function
error[E0282]: type annotations needed
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:137:12
|
137 | Ok(Buffer {
| ____________^
138 | | buffer_impl: self.surface_impl.buffer_mut()?,
139 | | _marker: PhantomData,
140 | | })
| |_________^ cannot infer type of the type parameter `D` declared on the struct `Buffer`
|
help: consider specifying the generic arguments
|
137 | Ok(Buffer::<D, W> {
| ++++++++
error[E0283]: type annotations needed
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:147:14
|
147 | self.window()
| ^^^^^^ cannot infer type for type parameter `D`
|
= note: cannot satisfy `_: HasDisplayHandle`
= help: the following types implement trait `HasDisplayHandle`:
NoDisplayHandle
Box<H>
DisplayHandle<'a>
Rc<H>
Arc<H>
&H
&mut H
note: required by a bound in `Surface::<D, W>::window`
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:80:9
|
80 | impl<D: HasDisplayHandle, W: HasWindowHandle> Surface<D, W> {
| ^^^^^^^^^^^^^^^^ required by this bound in `Surface::<D, W>::window`
...
101 | pub fn window(&self) -> &W {
| ------ required by a bound in this associated function
error[E0282]: type annotations needed
--> /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.4.2/src/lib.rs:156:23
|
156 | self.window().window_handle()
| ^^^^^^^^^^^^^ cannot infer type for type parameter `W`
Some errors have detailed explanations: E0282, E0283, E0392.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `softbuffer` (lib) due to 13 previous errors
warning: build failed, waiting for other jobs to finish...
- 主要语言
- Rust
- 星标
- 507
- 派生
- 84
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rust-windowing/softbuffer 的其他 Issue
-
DS - X11
难度 3/5 1-2 天 新手友好度 48/100
rust-windowing/softbuffer#368 ·
-
bug DS - Android NDK
难度 4/5 3-5 天 新手友好度 35/100
rust-windowing/softbuffer#347 · 1 条评论 ·
-
Needs Design Work
难度 5/5 一周以上 新手友好度 25/100
rust-windowing/softbuffer#342 · 1 条评论 ·
-
enhancement question
难度 5/5 一周以上 新手友好度 25/100
rust-windowing/softbuffer#338 ·
-
DS - Android NDK enhancement
难度 4/5 3-5 天 新手友好度 35/100
rust-windowing/softbuffer#318 · 2 条评论 ·
查看 rust-windowing/softbuffer 的全部 Issue
相似的 Issue
-
bug CLI exec tool-calls
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
-
maintainer-needed p2 triaged ui windows
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
ai_p2
难度 2/5 1-3 小时 新手友好度 76/100
ClickHouse/ClickHouse#123351 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 92/100
github/copilot-sdk#2804 · 1 条评论 ·
维护者通常 1 天内回复