Skip to content

Expand coverage to include recent changes#2364

Open
Hoverbear wants to merge 24 commits into
mainfrom
hoverbear/big-coverage-energy
Open

Expand coverage to include recent changes#2364
Hoverbear wants to merge 24 commits into
mainfrom
hoverbear/big-coverage-energy

Conversation

@Hoverbear

Copy link
Copy Markdown
Member

#2336 fixed a number of bugs in the #[ferrocene::prevalidated] lint, this handles coverage coming from those changes.

@Hoverbear Hoverbear self-assigned this May 5, 2026
@Hoverbear
Hoverbear force-pushed the hoverbear/big-coverage-energy branch from f80c2e1 to dcf5b91 Compare May 5, 2026 18:36
Hoverbear added a commit that referenced this pull request May 5, 2026
Ferrocene-backport-of: #2364
Comment thread library/coretests/tests/ferrocene/slice.rs Outdated

@skade skade left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left relevant review comments.

Comment thread library/core/src/fmt/mod.rs Outdated
Comment thread library/core/src/fmt/mod.rs Outdated
Comment thread library/core/src/slice/ascii.rs Outdated
@jyn514
jyn514 self-requested a review May 11, 2026 12:44
Comment thread library/core/src/intrinsics/mod.rs
Comment on lines +555 to +556
// We need to do a truly cursed thing here since there are no situations in public API where
// we can conjure ourselves a `ParseIntError` with a `NotAPowerOfTwo` in it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if this is really the case then shouldn't we instead mark that code as unreachable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are ways to create IntErrorKind::PowerOfTwo, but no ways to create a ParseIntError holding a IntErrorKind::PowerOfTwo I can find.

Are you suggesting replacing

IntErrorKind::NotAPowerOfTwo => "number is not a power of two",
with an unreachable? I think that's fair since we should catch test failures if that ever changes.

Do you consider that option better than my conjuration? 😅

@jyn514 jyn514 May 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

exactly, yes, mark specifically the Display impl with unreachable.

i think it's weird for upstream to reuse the type between different APIs like this, but that's another problem ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm rather unsure about making a load bearing change to the core library here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i was imagining something like this:

#[cfg(feature = "ferrocene_test")]
unreachable!();

Comment thread library/coretests/tests/ferrocene/str.rs
@jyn514 jyn514 added needs-forward-port waiting-on-author If this PR was opened by an automation, the "author" is the assignee. and removed needs-forward-port labels May 11, 2026
bors-ferrocene Bot added a commit that referenced this pull request May 11, 2026
2365: [1.95] prevalidated fix backport r=Hoverbear a=Hoverbear

Backports #2336 and #2364 as well as [`a96a73b`](a96a73b) which is new.

Co-authored-by: Jynn Nelson <[email protected]>
Co-authored-by: Urhengulas <[email protected]>
Co-authored-by: Ana Hobden <[email protected]>
bors-ferrocene Bot added a commit that referenced this pull request May 11, 2026
2365: [1.95] prevalidated fix backport r=Hoverbear a=Hoverbear

Backports #2336 and #2364 as well as [`a96a73b`](a96a73b) which is new.

Co-authored-by: Jynn Nelson <[email protected]>
Co-authored-by: Urhengulas <[email protected]>
Co-authored-by: Ana Hobden <[email protected]>
@Hoverbear
Hoverbear force-pushed the hoverbear/big-coverage-energy branch 2 times, most recently from 0837260 to ab05886 Compare July 15, 2026 15:22
@Hoverbear Hoverbear added waiting-on-review backport:1.97 and removed waiting-on-author If this PR was opened by an automation, the "author" is the assignee. labels Jul 15, 2026
@Hoverbear
Hoverbear force-pushed the hoverbear/big-coverage-energy branch from ab05886 to f303b43 Compare July 15, 2026 15:23
@Hoverbear
Hoverbear force-pushed the hoverbear/big-coverage-energy branch from f303b43 to 3721072 Compare July 15, 2026 17:36

@jyn514 jyn514 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for working on this, and sorry i forgot about it for so long.

bors merge

@jyn514

jyn514 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

bors r-

want to merge everything into 1.97 before we queue things up for main

@bors-ferrocene

Copy link
Copy Markdown
Contributor

Canceled.

jyn514 pushed a commit that referenced this pull request Jul 16, 2026
Expand coverage to include recent changes

#2336 fixed a number of bugs in the `#[ferrocene::prevalidated]` lint, this handles coverage coming from those changes.

Co-authored-by: Ana Hobden <[email protected]>

Ferrocene-backport-of: #2364
Ferrocene-backported-commits: 3721072 5808810 fdb51f2 f9dff13 5052acc a9304f9 1951cfa 9d1dbcd 047f112 45d607b 0188b6c b9b6949 04c0639 d835001 a0fa6f0 9996cb7 904d211 b79e758 bd9d73d 78f6a9b bc5cb1f c92b3ec 5fa8097 733a418
jyn514 pushed a commit that referenced this pull request Jul 16, 2026
Expand coverage to include recent changes

#2336 fixed a number of bugs in the `#[ferrocene::prevalidated]` lint, this handles coverage coming from those changes.

Co-authored-by: Ana Hobden <[email protected]>

Ferrocene-backport-of: #2364
Ferrocene-backported-commits: 3721072 5808810 fdb51f2 f9dff13 5052acc a9304f9 1951cfa 9d1dbcd 047f112 45d607b 0188b6c b9b6949 04c0639 d835001 a0fa6f0 9996cb7 904d211 b79e758 bd9d73d 78f6a9b bc5cb1f c92b3ec 5fa8097 733a418
@jyn514 jyn514 mentioned this pull request Jul 16, 2026
bors-ferrocene Bot added a commit that referenced this pull request Jul 16, 2026
2487: Backport to `release/1.97` r=jyn514 a=ferrocene-automations[bot]

This PR backports the following PRs to the `release/1.97` branch:

* #2429
* #2433
* #2364 (currently unmerged)
* #2475

Note that the automation failed to backport some PRs automatically. Check out the [backport:manual](https://github.com/ferrocene/ferrocene/pulls?q=is%3Apr+label%3Abackport%3Amanual) for a list of them.

Co-authored-by: Urhengulas <[email protected]>
Co-authored-by: Felix Gilcher <[email protected]>
Co-authored-by: Ana Hobden <[email protected]>
bors-ferrocene Bot added a commit that referenced this pull request Jul 16, 2026
2487: Backport to `release/1.97` r=jyn514 a=ferrocene-automations[bot]

This PR backports the following PRs to the `release/1.97` branch:

* #2429
* #2433
* #2364 (currently unmerged)
* #2475

Note that the automation failed to backport some PRs automatically. Check out the [backport:manual](https://github.com/ferrocene/ferrocene/pulls?q=is%3Apr+label%3Abackport%3Amanual) for a list of them.

Co-authored-by: Urhengulas <[email protected]>
Co-authored-by: Felix Gilcher <[email protected]>
Co-authored-by: Ana Hobden <[email protected]>
bors-ferrocene Bot added a commit that referenced this pull request Jul 16, 2026
2487: Backport to `release/1.97` r=jyn514 a=ferrocene-automations[bot]

This PR backports the following PRs to the `release/1.97` branch:

* #2429
* #2433
* #2364 (currently unmerged)
* #2475

Note that the automation failed to backport some PRs automatically. Check out the [backport:manual](https://github.com/ferrocene/ferrocene/pulls?q=is%3Apr+label%3Abackport%3Amanual) for a list of them.

Co-authored-by: Urhengulas <[email protected]>
Co-authored-by: Felix Gilcher <[email protected]>
Co-authored-by: Ana Hobden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants