-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
&pin!() stopped being deref-coerced in rust 1.88 #153425
Copy link
Copy link
Open
Labels
A-coercionsArea: implicit and explicit `expr as Type` coercionsArea: implicit and explicit `expr as Type` coercionsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-pinArea: PinArea: PinC-bugCategory: This is a bug.Category: This is a bug.F-super_letit's super, let's go!it's super, let's go!P-mediumMedium priorityMedium 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.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
A-coercionsArea: implicit and explicit `expr as Type` coercionsArea: implicit and explicit `expr as Type` coercionsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-pinArea: PinArea: PinC-bugCategory: This is a bug.Category: This is a bug.F-super_letit's super, let's go!it's super, let's go!P-mediumMedium priorityMedium 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.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I expected the following code to compile, since
PinimplementsDeref, so it should be possible to do a deref coercion from the type&Pin<i32>to the type&i32.The above code compiles without errors in rust 1.87.0. However, it produces the following compile error in rust 1.88.0
This presumably regressed in #139114, which changed
pin!()to usesuper let. This uses a block expression in the syntax, which then presumably runs into the bug in #23014.I don't know if there are any realistic use cases which run into this problem. (Hopefully not.)
cc @dianne @m-ou-se (who worked on
super let).cc @jackh726 (who seemed to have recently been working on coercions).
Meta
Tested on Godbolt with rustc versions 1.87.0 and 1.88.0.