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

Update svd2rust, svdtools #94

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jannic
Copy link
Member

@jannic jannic commented Apr 2, 2024

svd2rust → 0.33.0
svdtools → 0.3.12

I'm not 100% sure if adding type Safety to generic::Writable is a breaking change. Writable is a pub trait, but generic is not public, so it should be fine, I guess?
At least cargo semver-checks doesn't complain.

Copy link
Member

@9names 9names left a comment

Choose a reason for hiding this comment

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

Lgtm

@jannic
Copy link
Member Author

jannic commented Apr 2, 2024

@9names: After closer checking, even if cargo semver-checks doesn't report any issues, I'm convinced that this contains breaking changes: In fact the "Add IsEnum constraint for FieldWriters (fix variant safety)" change of svd2rust 0.33.0 does break rp2040-hal:

error[E0599]: the method `variant` exists for struct `FieldWriter<'_, CS_SPEC, 3>`, but its trait bounds were not satisfied
   --> rp2040-hal/src/adc.rs:383:39
    |
383 |             .modify(|_, w| w.ainsel().variant(pin.channel()).start_many().set_bit());
    |                                       ^^^^^^^ method cannot be called on `FieldWriter<'_, CS_SPEC, 3>` due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            `u8: IsEnum`
    = help: items from traits can only be used if the trait is implemented and in scope

I wonder if we should stop at svd2rust 0.32.0 for now. Would it be useful to create a 0.6.1 release before merging breaking changes?

@9names
Copy link
Member

9names commented Apr 3, 2024

Sounds like a plan. We'll need to deal with the breakage sooner or later, but cutting a release now before doing that is a good idea.

@jannic
Copy link
Member Author

jannic commented Apr 3, 2024

Sounds like a plan. We'll need to deal with the breakage sooner or later, but cutting a release now before doing that is a good idea.

That would be the older pull request #93. I just updated it to include the svdtools update.

@jannic
Copy link
Member Author

jannic commented Oct 1, 2024

A newer version of cargo semver-checks complains on current main with:

--- failure trait_associated_type_added: non-sealed public trait added associated type without default value ---

Description:
A non-sealed trait has gained an associated type without a default value, which breaks downstream implementations of the trait
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.35.0/src/lints/trait_associated_type_added.ron

Failed in:
  trait associated type rp2040_pac::generic::Writable::Safety in file rp2040-pac/src/generic.rs:64

While I think that this is a very minor breaking change (it's quite unlikely that people try to define their own registers), it makes releasing a 0.6.1 questionable.
(And if we want to, we can still do that later, based on an older commit, even if we now merge further updates to main.)

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