Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embassy-usb: fix building with optional log feature #3692

Merged
merged 2 commits into from
Dec 29, 2024

Conversation

9names
Copy link
Contributor

@9names 9names commented Dec 28, 2024

Trying to build embassy-usb before this fix:

cargo build --features log
   Compiling embassy-usb v0.3.0 (/home/nine/vc/rust/embassy_fmt_fixes/embassy-usb)
error[E0277]: `[u8]` doesn't implement `Display`
   --> src/class/uac1/speaker.rs:583:53
    |
583 |                 endpoint_address, control_selector, data
    |                                                     ^^^^ `[u8]` cannot be formatted with the default formatter
    |
    = help: the trait `Display` is not implemented for `[u8]`, which is required by `&[u8]: Display`
    = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
    = note: this error originates in the macro `$crate::__private_api::format_args` which comes from the expansion of the macro `debug` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `InterfaceNumber` doesn't implement `Display`
   --> src/class/uac1/speaker.rs:737:13
    |
737 |             iface, alternate_setting
    |             ^^^^^ `InterfaceNumber` cannot be formatted with the default formatter
    |
    = help: the trait `Display` is not implemented for `InterfaceNumber`
    = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
    = note: this error originates in the macro `$crate::__private_api::format_args` which comes from the expansion of the macro `debug` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `embassy-usb` (lib) due to 2 previous errors

@Dirbaio
Copy link
Member

Dirbaio commented Dec 28, 2024

could you add an entry to ci.sh that would've caught this, so it doesn't regress in the future? thanks!

@Dirbaio
Copy link
Member

Dirbaio commented Dec 29, 2024

thanks!

@Dirbaio Dirbaio added this pull request to the merge queue Dec 29, 2024
Merged via the queue into embassy-rs:main with commit 509c60b Dec 29, 2024
7 checks passed
@9names 9names deleted the embassy-usb-fix-build-w-log branch December 29, 2024 11:12
--- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-interface-count-1 \
--- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-interface-count-8 \
--- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-handler-count-8 \
--- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-handler-count-8 \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate line (Probably "max-handler-count-1"?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants