-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Improve alloc::Layout
coverage
#146452
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
Improve alloc::Layout
coverage
#146452
Conversation
|
r? libs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, could you please add some short comments explaining why these cases should fail? It’s not obvious to me, and it would help future readers who are also not experts in layouts and memory models
be6081b
to
93dd7b6
Compare
@Kivooeo thanks for the review, I force pushed a new commit with comments that explain each assertion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion here then LGTM.
It would be good to add doctests to these at some point, too, repeat_packed
and extend_packed
don't seem to have any examples or other test coverage. Not here, of course.
93dd7b6
to
771db1f
Compare
771db1f
to
18059a0
Compare
Thanks! @bors r+ rollup |
…rage, r=tgross35 Improve `alloc::Layout` coverage This PR improves the `core::alloc` coverage by adding a new test to `coretests` that cover the `Layout` methods when they error. Tracking issue: rust-lang#55724
Rollup of 4 pull requests Successful merges: - #146389 (Convert `no_std` and `no_core` to the new attribute infrastructure) - #146452 (Improve `alloc::Layout` coverage) - #146473 (Revert "Constify SystemTime methods") - #146477 (Improve `core::char` coverage) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 5 pull requests Successful merges: - #146389 (Convert `no_std` and `no_core` to the new attribute infrastructure) - #146403 (sort array trait implementation suggestions correctly) - #146452 (Improve `alloc::Layout` coverage) - #146477 (Improve `core::char` coverage) - #146481 (Improve `core::hash` coverage) r? `@ghost` `@rustbot` modify labels: rollup
This PR improves the
core::alloc
coverage by adding a new test tocoretests
that cover theLayout
methods when they error.Tracking issue: #55724
r? @workingjubilee