[GH-ISSUE #12] multiple map_err found #11

Closed
opened 2026-02-27 21:01:11 +03:00 by kerem · 3 comments
Owner

Originally created by @sg4r on GitHub (Mar 29, 2021).
Original GitHub issue: https://github.com/sg4r/proxmox-backup-client/issues/12

hi,
when i build with cargo i have the error since version 1.0.8, but not with previous versions.
an idea ?
see branch v1.0.11

cargo build --release --bin proxmox-backup-client --bin pxar
...
Compiling proxmox v0.11.0 (git://git.proxmox.com/git/proxmox.git?rev=1fce0ff41ddeb177f92874bf4e95a775cfd99c69#1fce0ff4)
Compiling zstd-sys v1.4.13+zstd.1.4.3
Compiling zstd-safe v1.4.13+zstd.1.4.3
Compiling zstd v0.4.28+zstd.1.4.3
Compiling proxmox-backup v1.0.11 (/root/proxmox-backup-client/proxmox-backup)
error[E0034]: multiple applicable items in scope
--> src/server/rest.rs:310:10
|
310 | .map_err(|err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err))
| ^^^^^^^ multiple map_err found
|
= note: candidate #1 is defined in an impl of the trait HttpBody for the type Body
= note: candidate #2 is defined in an impl of the trait futures::TryFutureExt for the type Fut
= note: candidate #3 is defined in an impl of the trait futures::TryStreamExt for the type S
help: disambiguate the associated function for candidate #1
|
309 | let body = HttpBody::map_err(req_body, |err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #2
|
309 | let body = futures::TryFutureExt::map_err(req_body, |err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #3
|
309 | let body = futures::TryStreamExt::map_err(req_body, |err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the size for values of type [u8] cannot be known at compilation time
--> src/server/rest.rs:309:9
|
309 | let body = req_body
| ^^^^ doesn't have a size known at compile-time
|
= help: the trait Sized is not implemented for [u8]
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type [u8] cannot be known at compilation time
--> src/server/rest.rs:309:16
|
309 | let body = req_body
| ________________^
310 | | .map_err(|err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err))
311 | | .try_fold(Vec::new(), |mut acc, chunk| async move {
312 | | if acc.len() + chunk.len() < 64*1024 { //fimxe: max request body size?
... |
317 | | }
318 | | }).await?;
| |_________________^ doesn't have a size known at compile-time
|
= help: the trait Sized is not implemented for [u8]
= note: all local variables must have a statically known size

Originally created by @sg4r on GitHub (Mar 29, 2021). Original GitHub issue: https://github.com/sg4r/proxmox-backup-client/issues/12 hi, when i build with cargo i have the error since version 1.0.8, but not with previous versions. an idea ? see branch v1.0.11 cargo build --release --bin proxmox-backup-client --bin pxar ... Compiling proxmox v0.11.0 (git://git.proxmox.com/git/proxmox.git?rev=1fce0ff41ddeb177f92874bf4e95a775cfd99c69#1fce0ff4) Compiling zstd-sys v1.4.13+zstd.1.4.3 Compiling zstd-safe v1.4.13+zstd.1.4.3 Compiling zstd v0.4.28+zstd.1.4.3 Compiling proxmox-backup v1.0.11 (/root/proxmox-backup-client/proxmox-backup) error[E0034]: multiple applicable items in scope --> src/server/rest.rs:310:10 | 310 | .map_err(|err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err)) | ^^^^^^^ multiple `map_err` found | = note: candidate #1 is defined in an impl of the trait `HttpBody` for the type `Body` = note: candidate #2 is defined in an impl of the trait `futures::TryFutureExt` for the type `Fut` = note: candidate #3 is defined in an impl of the trait `futures::TryStreamExt` for the type `S` help: disambiguate the associated function for candidate #1 | 309 | let body = HttpBody::map_err(req_body, |err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function for candidate #2 | 309 | let body = futures::TryFutureExt::map_err(req_body, |err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function for candidate #3 | 309 | let body = futures::TryStreamExt::map_err(req_body, |err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> src/server/rest.rs:309:9 | 309 | let body = req_body | ^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` = note: all local variables must have a statically known size = help: unsized locals are gated as an unstable feature error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> src/server/rest.rs:309:16 | 309 | let body = req_body | ________________^ 310 | | .map_err(|err| http_err!(BAD_REQUEST, "Promlems reading request body: {}", err)) 311 | | .try_fold(Vec::new(), |mut acc, chunk| async move { 312 | | if acc.len() + chunk.len() < 64*1024 { //fimxe: max request body size? ... | 317 | | } 318 | | }).await?; | |_________________^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` = note: all local variables must have a statically known size
kerem closed this issue 2026-02-27 21:01:11 +03:00
Author
Owner

@1nv0k32 commented on GitHub (Mar 29, 2021):

I found this patch on AUR:
https://aur.archlinux.org/cgit/aur.git/tree/0003-fix-map_err.patch?h=proxmox-backup-client

<!-- gh-comment-id:809242902 --> @1nv0k32 commented on GitHub (Mar 29, 2021): I found this patch on AUR: [https://aur.archlinux.org/cgit/aur.git/tree/0003-fix-map_err.patch?h=proxmox-backup-client](url)
Author
Owner

@sg4r commented on GitHub (Mar 29, 2021):

hi 1nv0k32,
Thanks for the patch that corrects this problem.
I now have a link problem #14

<!-- gh-comment-id:809720291 --> @sg4r commented on GitHub (Mar 29, 2021): hi 1nv0k32, Thanks for the patch that corrects this problem. I now have a link problem #14
Author
Owner

@sg4r commented on GitHub (Apr 5, 2021):

it's corrected.

<!-- gh-comment-id:813546217 --> @sg4r commented on GitHub (Apr 5, 2021): it's corrected.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-backup-client#11
No description provided.