-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Using impl Trait with closure local functions across crates results in ICE #43135
Copy link
Copy link
Closed
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Metadata
Metadata
Assignees
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Type
Fields
Give feedbackNo fields configured for issues without a type.
Having an
impl Traittype, containing a closure, where the closure has a locally defined function inside it, being passed across crate boundaries, results in an ICE.The following function, defined in one crate, then used in another:
gives the error:
Presumably related to #40839/#35870, I found this while trying to come up with a decent workaround for #40839 specifically.
I have pushed a full testcase to https://github.com/Nemo157/impl-trait-across-crates, try building the
foo2crate.