WIP: Fix up some possible lifetime issues in newer editions #707

Draft
KodrAus wants to merge 1 commit from fix/lifetime-rules into master
KodrAus commented 2025-10-19 05:28:03 -05:00 (Migrated from github.com)

For #706

For #706
Thomasdezeeuw (Migrated from github.com) reviewed 2025-10-19 05:45:39 -05:00
@ -20,3 +20,3 @@
impl<'a> KVs<'a> for &'a [(&'a str, Value<'a>)] {
impl<'a, const N: usize> KVs<'a> for &'a [(&'a str, Value<'a>); N] {
#[inline]
Thomasdezeeuw (Migrated from github.com) commented 2025-10-19 05:45:37 -05:00

I'm fine with the change. I do wonder if this changes the binary size as now create code per N/size, but I don't know if this will impact anything.

I'm fine with the change. I do wonder if this changes the binary size as now create code per `N`/size, but I don't know if this will impact anything.
Thomasdezeeuw (Migrated from github.com) commented 2025-10-19 05:45:00 -05:00

The code block shouldn't matter right? (fine with the code change though)

The code block shouldn't matter right? (fine with the code change though)
KodrAus (Migrated from github.com) reviewed 2025-10-19 14:25:51 -05:00
KodrAus (Migrated from github.com) commented 2025-10-19 14:25:51 -05:00

You'd think not, but this is one of the edition-based lifetime changes. In the 2024 edition, this borrow is for a lifetime that doesn't outlive the block.

You'd think not, but this is one of the edition-based lifetime changes. In the 2024 edition, this borrow is for a lifetime that doesn't outlive the block.
KodrAus (Migrated from github.com) reviewed 2025-10-19 14:28:04 -05:00
@ -20,3 +20,3 @@
impl<'a> KVs<'a> for &'a [(&'a str, Value<'a>)] {
impl<'a, const N: usize> KVs<'a> for &'a [(&'a str, Value<'a>); N] {
#[inline]
KodrAus (Migrated from github.com) commented 2025-10-19 14:28:03 -05:00

I couldn't actually trigger the same build failure reported in #706 yet, so this one is purely speculative right now.

The change in code size is a good point, I'll measure it and see what impact it has. I wouldn't be surprised if it made no difference, but is definitely worth checking.

I couldn't actually trigger the same build failure reported in #706 yet, so this one is purely speculative right now. The change in code size is a good point, I'll measure it and see what impact it has. I wouldn't be surprised if it made no difference, but is definitely worth checking.
rustbot commented 2026-06-01 15:54:08 -05:00 (Migrated from github.com)

☔ The latest upstream changes (possibly #727) made this pull request unmergeable. Please resolve the merge conflicts.

:umbrella: The latest upstream changes (possibly #727) made this pull request unmergeable. Please [resolve the merge conflicts](https://rustc-dev-guide.rust-lang.org/git.html#rebasing-and-conflicts).
This pull request has changes conflicting with the target branch.
  • src/__private_api.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'fix/lifetime-rules:fix/lifetime-rules'
git switch 'fix/lifetime-rules'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'master'
git merge --no-ff 'fix/lifetime-rules'
git switch 'fix/lifetime-rules'
git rebase 'master'
git switch 'master'
git merge --ff-only 'fix/lifetime-rules'
git switch 'fix/lifetime-rules'
git rebase 'master'
git switch 'master'
git merge --no-ff 'fix/lifetime-rules'
git switch 'master'
git merge --squash 'fix/lifetime-rules'
git switch 'master'
git merge --ff-only 'fix/lifetime-rules'
git switch 'master'
git merge 'fix/lifetime-rules'
git push origin 'master'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-rust-lang/log!707
No description provided.