-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
This error looks pretty bizarre, right? Especially the "help:" message, which is clearly not helpful at all. (This is from the current nightly.)
error[E0277]: the trait bound `B: Basics` is not satisfied
--> src\collision_detection\simple_grid.rs:115:1
|
115 | pub fn insert_predictors <B: Basics, Settings: TimeStewardSettings <B>> (s
ettings: Settings) {
| ^ trait `B: Basics` not satisfied
|
= help: consider adding a `where B: Basics` bound
= note: required by `TimeStewardSettings`
What happened is that I had two traits named Basics, one in the crate root and one in the current module. Presumably, the compiler could give a clearer error message in this situation, although I'm not sure what the best way to handle it is – it would obviously be bad to give the full path for every trait mentioned in an error message. Maybe it should give the full path exactly when there are two traits (or other objects) with the same name?
WillSewell
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.