Skip to content

Conversation

p-ackland
Copy link
Contributor

Due to a conflicting implementation of PartialOrd in deranged 0.4.1 which is a transitive dependency of aws-config, type inference in usize < NonZeroUsize no longer works.

The maintainer of deranged has indicated that he wont be reverting this change and downstream libs need to be updated to resolve the issue.

Conflicting impls:

deranged 0.4.1

impl<MIN, MAX> PartialOrd<deranged::RangedUsize<MIN, MAX>> for usize

core

impl PartialOrd for usize

This issue is only present with feature awssdk enabled.

Error:

error[E0283]: type annotations needed
   --> src/export.rs:130:56
    |
130 |                     if queue.len() < config.batch_size.into() {
    |                                    -                   ^^^^
    |                                    |
    |                                    type must be known at this point
    |
    = note: multiple `impl`s satisfying `usize: PartialOrd<_>` found in the following crates: `core`, `deranged`:
            - impl PartialOrd for usize;
            - impl<MIN, MAX> PartialOrd<deranged::RangedUsize<MIN, MAX>> for usize
              where the constant `MIN` has type `usize`, the constant `MAX` has type `usize`;
help: try using a fully qualified path to specify the expected types
    |
130 |                     if queue.len() < <NonZero<usize> as Into<T>>::into(config.batch_size) {
    |                                      ++++++++++++++++++++++++++++++++++                 ~

For more information about this error, try `rustc --explain E0283`.
error: could not compile `tracing-cloudwatch` (lib) due to 1 previous error

@ymgyt ymgyt self-requested a review March 25, 2025 03:05
Copy link
Owner

@ymgyt ymgyt left a comment

Choose a reason for hiding this comment

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

Thank you for the detailed explanation.

@ymgyt ymgyt merged commit 1ff5abf into ymgyt:main Mar 25, 2025
1 check passed
@ymgyt
Copy link
Owner

ymgyt commented Mar 25, 2025

We've released v0.3.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.

2 participants