Skip to content

Conversation

@gschulze
Copy link
Contributor

This PR adds support for printing detailed error messages when there is not enough space or an alignment mismatch.

Copy link
Contributor

@eholk eholk left a comment

Choose a reason for hiding this comment

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

This seems like a nice ergonomic improvement. Thank you!

It looks like you need to sign the CLA, but I'd be happy to merge this patch once we're all good on that part.

src/lib.rs Outdated
if !StackFuture::<F, STACK_SIZE>::has_space_for::<F>() {
panic!("F is too large");
concat_panic!(
"F is too large: ",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"F is too large: ",
"Future is too large: ",

I feel like seeing Future instead of F will make it clearer to the user what is wrong. Maybe "Future F is too large" would be even clearer...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I changed the panic messages according to your suggestion and also suppressed the 'dead_code' linter errors in the tests.

src/lib.rs Outdated
if !StackFuture::<F, STACK_SIZE>::has_alignment_for::<F>() {
panic!("F has incompatible alignment");
concat_panic!(
"F has incompatible alignment: ",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"F has incompatible alignment: ",
"Future has incompatible alignment: ",

@gschulze
Copy link
Contributor Author

@microsoft-github-policy-service agree

@eholk
Copy link
Contributor

eholk commented Oct 30, 2025

It looks like your CI is failing due to existing issues. I'll fix these over in #25.

@eholk
Copy link
Contributor

eholk commented Nov 3, 2025

Ah, unfortunately, we both added the #[allow] attributes and now clippy is failing again. Would you mind rebasing your changes?

@gschulze gschulze force-pushed the feature/detailed-panic-messages branch 2 times, most recently from 5029c4b to 611c6af Compare November 18, 2025 21:52
@gschulze
Copy link
Contributor Author

@eholk sorry for the late reply; I rebased the branch and dropped the last commit, should be fine now.

@eholk eholk merged commit 17241d3 into microsoft:main Nov 18, 2025
5 checks passed
@eholk
Copy link
Contributor

eholk commented Nov 18, 2025

Awesome, thanks! I just merged it.

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