Confusing interaction between deref coercion and unknown type #56036
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I wrote something like the following code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=4be367b5c1d5a1d3d6eb20001c171825
Notice that the actual error is the missing
function_that_doesnt_exist
, but the compiler confusingly reports errors aboutstr
not having a size known at compile time, presumably because it infers the type ofs
asstr
. When I was writing this code, I missed the message about the missing function, so I was left scratching my head for a bit. It might be nice to silence such errors when the type of the variable is unknowable.The text was updated successfully, but these errors were encountered: