Incorrect suggestion given private function #64711
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`.
A-visibility
Area: Visibility / privacy.
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In
constants.rs
I have a private method:fn defaultConfig() -> bool { ... }
.If I import all members into another file using:
use crate::constants::*
, then calldefaultConfig
, I get the following error:However, the suggested fix won't help. Adding
use crates::constants::defaultConfig
suggests addingpub
todefaultConfig
. Suggestingcrates::constants::defaultConfig
isn't useful when we already havecrates::constants::*
, so should go straight to the suggestion about addingpub
?The text was updated successfully, but these errors were encountered: