Bogus extra error about unsized variable (the trait bound str: std::marker::Sized
is not satisfied)
#44504
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given code like this (not complete):
The first error is correct but the second is nonsense:
There's an extra error here.
json1
is used in a way (with thefrom_str
function) that it should be astr
or something that derefs tostr
. The second error message supposes it is astr
, which is nonsense that the user doesn't intend at all. (If the user would only find the right name of the function, they would get a String in the json variable and the next line compiles fine.)The text was updated successfully, but these errors were encountered: