E0428: Duplicate Definition Message in Circular include! Cases #136527
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Or something like:
Rationale and extra context
It says "
function
redefined here" and also "previous definition of the valuefunction
here." It appears to be referring to only one place, but it reads as though there is supposed to be a second "here" that is being left out, especially since that (showing two locations) is how this error message normally works.The sentence "the name
function
is defined multiple times" also is confusing. In the source code, there's only one definition offunction
.The error explanation doesn't mention this as a cause either. Not knowing the cause of the error, a user might:
without being able to determine the cause of the error. Of course, many or most would realize the true problem quickly, but the error message appears more confusing than other similar circular errors.
The cause of this error is circular use of the !include macro.
Other cases
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: