Cannot infer type in test from section 12.4 of rust book v2 #45164
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inference
Area: Type inference
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hello everyone!
I'm learning Rust now using this book and faced strange(as for me) error on section 12.4 when running tests.
You can reproduce a bug with next snippet of code
However, it's fairly obvious that compiler knows the type annotation that must be infered from vec![] macro. Next snippet makes it clear
I think it's a bug but not sure since I'm novice in rust. I tried different toolchains, specifically 1.16, 1.18, 1.20(stable) and nightly and got the same result.
The text was updated successfully, but these errors were encountered: