-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Undocumented soundness fix between 1.34 and 1.35 #76147
Copy link
Copy link
Open
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-edition-2018Area: The 2018 editionArea: The 2018 editionC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-edition-2018Area: The 2018 editionArea: The 2018 editionC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I compiled a rather old project of mine for the first time in quite a while and was surprised that it no longer compiled on stable, which it did way back in 1.34.
Non-minimized regression demo: https://rust.godbolt.org/z/f9n6h8
The core of the problem is this bit of code:
It turns out that it was always wrong -- I meant to get a
*mut Entry, not a*mut &mut Entry-- so I think this is probably an allowed breaking change?But it's not documented in the release notes for 1.35, which surprised me.
It's not obvious to me exactly what got fixed here. Is a temporary lifetime different, or is borrowck just detecting something it didn't used to? (Both examples are on edition 2018, so I think MIR borrowck?)