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

Support generic types that need multiple bounds #377

Merged
merged 2 commits into from
Nov 8, 2024
Merged

Support generic types that need multiple bounds #377

merged 2 commits into from
Nov 8, 2024

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Nov 8, 2024

No description provided.

    error[E0277]: the trait bound `T: UpperHex` is not satisfied
       --> tests/test_generics.rs:179:13
        |
    178 |     #[derive(Error, Debug)]
        |              ----- in this derive macro expansion
    179 |     #[error("0x{thing:x} 0x{thing:X}")]
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `UpperHex` is not implemented for `T`
        |
        = note: required for `&T` to implement `UpperHex`
    note: required by a bound in `core::fmt::rt::Argument::<'_>::new_upper_hex`
       --> $RUSTUP_HOME/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/rt.rs:133:29
        |
    133 |     pub fn new_upper_hex<T: UpperHex>(x: &T) -> Argument<'_> {
        |                             ^^^^^^^^ required by this bound in `Argument::<'_>::new_upper_hex`
        = note: this error originates in the macro `$crate::format_args` which comes from the expansion of the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
@dtolnay dtolnay merged commit 8e5c843 into master Nov 8, 2024
20 checks passed
@dtolnay dtolnay deleted the bounds branch November 8, 2024 17:51
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.

1 participant