-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
closures in dead code are no longer borrowchecked #140583
Copy link
Copy link
Closed
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.P-criticalCritical priorityCritical priorityT-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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.P-criticalCritical priorityCritical priorityT-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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I minimized this code from a
compile_faildoctest that started compiling in nightly even though it didn't in stable. I appended a minified (probably not minimal) example below.Replacing
todo!()with5for example causes it to fail to compile on nightly as well. Therefore I'm not quite sure whether this really counts as a regresssion, it does not seem to be planned / mentioned anywhere though.cargo bisect-rustcpoints to d4f880f, merge of #138499 (nightly 2025-04-09).Code
I tried this code:
I expected to see this happen:
Instead, this happened: compiled successfully
Version it worked on
It most recently worked on: Rust 1.86, Rust 1.87 Beta.7, Rust Nightly 2025-04-08
Version with regression
rustc --version --verbose: