Strange inference failure with Arc::new_cyclic
#139736
Labels
A-inference
Area: Type inference
C-discussion
Category: Discussion or questions that doesn't represent real issues.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code (playground):
I expected to see this happen: It compiles
Instead, this happened: It does not compile
I find it very strange the type inference is unable to figure out that
a.
new_cyclic
returns anArc<Self>
b. the closure returns a
Foo
I find it even stranger that commenting out the line where the inner value is used ("Fix" 2) makes it compile.
Compiler Error:
rustc version:
The text was updated successfully, but these errors were encountered: