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

"trait_method_missing: pub trait method removed or renamed" but the method is there since 2020 #536

Closed
wiktor-k opened this issue Sep 11, 2023 · 3 comments · Fixed by #541
Labels
C-bug Category: doesn't meet expectations

Comments

@wiktor-k
Copy link

Steps to reproduce the bug with the above code

Hi,

I've got slight problems running cargo-semver-checks on a bigger crate and was advised to file an issue here.

Steps to reproduce:

$ git clone https://gitlab.com/sequoia-pgp/sequoia
$ cd sequoia/openpgp/
$ git checkout a8127384578bb815e07258f6ad1dc65c5e55a187
$ cargo semver-checks --default-features
     Parsing sequoia-openpgp v1.16.0 (current)
     Parsing sequoia-openpgp v1.16.0 (baseline, cached)
    Checking sequoia-openpgp v1.16.0 -> v1.16.0 (no change)
   Completed [   0.378s] 48 checks; 46 passed, 2 failed, 0 unnecessary

--- failure trait_method_missing: pub trait method removed or renamed ---

Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#major-any-change-to-trait-item-signatures
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.23.0/src/lints/trait_method_missing.ron

Failed in:
  method map of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:401

Actual Behaviour

The report shows a lot of issues while it's not clear what exactly is wrong:

error log
--- failure trait_method_missing: pub trait method removed or renamed ---

Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#major-any-change-to-trait-item-signatures
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.23.0/src/lints/trait_method_missing.ron

Failed in:
method preferred_symmetric_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:456
method preferred_symmetric_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:456
method preferred_symmetric_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:456
method preferred_hash_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:463
method preferred_hash_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:463
method preferred_hash_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:463
method preferred_compression_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:470
method preferred_compression_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:470
method preferred_compression_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:470
method preferred_aead_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:477
method preferred_aead_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:477
method preferred_aead_algorithms of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:477
method key_server_preferences of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:480
method key_server_preferences of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:480
method key_server_preferences of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:480
method preferred_key_server of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:484
method preferred_key_server of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:484
method preferred_key_server of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:484
method features of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:487
method features of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:487
method features of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:487
method policy_uri of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:491
method policy_uri of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:491
method policy_uri of trait Preferences, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert.rs:491
method primary of trait PrimaryKey, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation/key.rs:345
method primary of trait PrimaryKey, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation/key.rs:345
method primary of trait PrimaryKey, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation/key.rs:345
method with_policy of trait ValidateAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:329
method with_policy of trait ValidateAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:329
method with_policy of trait ValidateAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:329
method map of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:401
method map of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:401
method map of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:401
method cert of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:431
method cert of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:431
method cert of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:431
method time of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:461
method time of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:461
method time of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:461
method policy of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:488
method policy of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:488
method policy of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:488
method binding_signature of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:514
method binding_signature of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:514
method binding_signature of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:514
method direct_key_signature of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:548
method direct_key_signature of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:548
method direct_key_signature of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:548
method revocation_status of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:602
method revocation_status of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:602
method revocation_status of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:602
method revocation_keys of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:647
method revocation_keys of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:647
method revocation_keys of trait ValidAmalgamation, previously in file /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:647

--- failure trait_removed_associated_type: trait's associated type was removed ---

Description:
A public trait's associated type was removed or renamed.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.23.0/src/lints/trait_removed_associated_type.ron

Failed in:
associated type ValidateAmalgamation::V, previously at /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:324
associated type ValidateAmalgamation::V, previously at /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:324
associated type ValidateAmalgamation::V, previously at /home/wiktor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sequoia-openpgp-1.16.0/src/cert/amalgamation.rs:324
Final [ 0.387s] semver requires new major version: 2 major and 0 minor checks failed

Expected Behaviour

I think it should clearly describe why it's failing. Let's take one example:

A trait method is no longer callable, and may have been renamed or removed entirely.
Failed in:
  method map of trait ValidAmalgamation,

But the method is there: https://docs.rs/sequoia-openpgp/latest/sequoia_openpgp/cert/amalgamation/trait.ValidAmalgamation.html#method.map and git blame shows it's been the same since 2020-04-11 22:52:18 +0200.

Generated System Information

Software version

cargo-semver-checks 0.23.0

Operating system

Linux 6.4.12-arch1-1

Command-line

/home/wiktor/.cargo/bin/cargo-semver-checks semver-checks --bugreport 

cargo version

> cargo -V 
cargo 1.72.0 (103a7ff2e 2023-08-15)

Compile time information

  • Profile: release
  • Target triple: x86_64-unknown-linux-gnu
  • Family: unix
  • OS: linux
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: adx,aes,avx,avx2,bmi1,bmi2,cmpxchg16b,f16c,fma,fxsr,lzcnt,movbe,pclmulqdq,popcnt,rdrand,rdseed,sha,sse,sse2,sse3,sse4.1,sse4.2,ssse3,xsave,xsavec,xsaveopt,xsaves
  • Host: x86_64-unknown-linux-gnu

Build Configuration

No response

Additional Context

No response

@wiktor-k wiktor-k added the C-bug Category: doesn't meet expectations label Sep 11, 2023
@obi1kenobi
Copy link
Owner

Thanks for opening this. It does seem suspicious.

If you have a second, could you re-run this with --verbose --verbose added to the invocation and post the log? That will help us distinguish between "the error message is bad but the lint is correct" and "the lint is incorrectly flagging this."

@wiktor-k
Copy link
Author

If you have a second, could you re-run this with --verbose --verbose added to the invocation and post the log? That will help us distinguish between "the error message is bad but the lint is correct" and "the lint is incorrectly flagging this."

Yep, definitely. I attach the log of running cargo semver-checks --default-features --verbose --verbose. (it has 34 KiB so I don't want to paste it verbatim here).

@obi1kenobi
Copy link
Owner

obi1kenobi commented Sep 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: doesn't meet expectations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants