Skip to content

Conversation

pvdrz
Copy link
Contributor

@pvdrz pvdrz commented Sep 11, 2025

This PR improves the core::alloc coverage by adding a new test to coretests that cover the Layout methods when they error.

Tracking issue: #55724

r? @workingjubilee

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 11, 2025

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

@workingjubilee
Copy link
Member

r? libs

@rustbot rustbot assigned tgross35 and unassigned workingjubilee Sep 11, 2025
Copy link
Member

@Kivooeo Kivooeo left a 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

View changes since this review

@pvdrz pvdrz force-pushed the pvdrz/improve-alloc-coverage branch from be6081b to 93dd7b6 Compare September 12, 2025 01:54
@pvdrz
Copy link
Contributor Author

pvdrz commented Sep 12, 2025

@Kivooeo thanks for the review, I force pushed a new commit with comments that explain each assertion

Copy link
Contributor

@tgross35 tgross35 left a 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.

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 12, 2025
@tgross35 tgross35 changed the title Improve core::alloc coverage Improve alloc::Layout coverage Sep 12, 2025
@pvdrz pvdrz force-pushed the pvdrz/improve-alloc-coverage branch from 93dd7b6 to 771db1f Compare September 12, 2025 15:32
@pvdrz pvdrz requested a review from tgross35 September 12, 2025 15:36
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 12, 2025
@pvdrz pvdrz force-pushed the pvdrz/improve-alloc-coverage branch from 771db1f to 18059a0 Compare September 12, 2025 15:50
@tgross35
Copy link
Contributor

Thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 12, 2025

📌 Commit 18059a0 has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 12, 2025
jdonszelmann added a commit to jdonszelmann/rust that referenced this pull request Sep 12, 2025
…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
bors added a commit that referenced this pull request Sep 12, 2025
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
bors added a commit that referenced this pull request Sep 13, 2025
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
@bors bors merged commit e4dbbbd into rust-lang:master Sep 13, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 13, 2025
rust-timer added a commit that referenced this pull request Sep 13, 2025
Rollup merge of #146452 - ferrocene:pvdrz/improve-alloc-coverage, 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: #55724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants