Skip to content

feat: add bound attribute#1044

Open
vic1707 wants to merge 1 commit intoknurling-rs:mainfrom
vic1707:bound-derive-attribute
Open

feat: add bound attribute#1044
vic1707 wants to merge 1 commit intoknurling-rs:mainfrom
vic1707:bound-derive-attribute

Conversation

@vic1707
Copy link
Copy Markdown
Contributor

@vic1707 vic1707 commented Mar 27, 2026

fixes #1043

Tired my best to create meaningful tests, if you have better ideas please tell me!

@knoellle
Copy link
Copy Markdown
Member

knoellle commented Apr 20, 2026

Thank you for your contribution!
I like the feature and the implementation looks good to me. Once the CI is happy, I'm inclined to merge this.

  • The CI / ui check that failed should already be fixed in Pin trybuild to 1.0.89  #1049
  • The lint check just needs a cargo format
  • The last one needs a good sprinkle of #[allow(dead_code)] just like many of the other types in that test file. Or if you're feeling fancy you can actually instantiate the types and print them 😉.

@vic1707 vic1707 force-pushed the bound-derive-attribute branch 3 times, most recently from d85e9ad to da4469b Compare April 21, 2026 13:10
@vic1707
Copy link
Copy Markdown
Contributor Author

vic1707 commented Apr 21, 2026

Hi,
Just rebased on latest main, applied fmt/lint, and edited the changelog.
I believe the failling CI isn't related to this PR as trybuild also fails on untouched ui tests 🤔

knoellle
knoellle previously approved these changes Apr 24, 2026
Copy link
Copy Markdown
Member

@knoellle knoellle left a comment

Choose a reason for hiding this comment

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

The main CI breakage should be fixed with

Please rebase and try again. Enable merge when ready when you're happy with it.
You will have to regenerate the stderr for your new tests with Rust 1.83 since #1052 changes the Rust version used for those tests.

Comment thread CHANGELOG.md
@jonathanpallant
Copy link
Copy Markdown
Contributor

Could we get this added to the defmt book, to explain how what the underlying issue is, and how to use this to fix it?

@vic1707 vic1707 force-pushed the bound-derive-attribute branch 2 times, most recently from 367c656 to 4d8f057 Compare April 24, 2026 22:06
@vic1707 vic1707 force-pushed the bound-derive-attribute branch from 4d8f057 to 2e808e4 Compare April 24, 2026 22:09
@vic1707
Copy link
Copy Markdown
Contributor Author

vic1707 commented Apr 24, 2026

Hi, the rebase is done, CI is passing, and I’ve added the reference 👍

Is the book request addressed to me? I have to admit I’m not sure where in the book this should go nor how best to explain it 😓

@knoellle
Copy link
Copy Markdown
Member

Yes @vic1707, if you could add some documentation, that would be lovely.
I think adding a section in book/src/format.md should be sufficient, similar to the section about uncompressed adapters.
Having a minimal example showing usage and a few sentences about when/why its useful would be great.

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.

derive(Format): add bound attributes for custom bounds

3 participants