Closed alefminus closed 1 year ago
I don't think this is a misreport of a circular import. use crate::definer::S;
has private visibility so when definer.rs
tries to use that export it fails due to privacy rules.
You can see it a little better if you rename the import: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=97bc270eea6957231a83eac4826269c4
Notably, making the import public reveals a better error message: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0a1cb80ba69afe0e88b47fda7fd11983
That makes sense. Thanks for the help.
On Mon, Feb 6, 2023 at 10:50 AM Edward Shen @.***> wrote:
I don't think this is a misreport of a circular import. use crate::definer::S; has private visibility so when definer.rs tries to use that export it fails due to privacy rules.
You can see it a little better if you rename the import: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=97bc270eea6957231a83eac4826269c4
Notably, making the import public reveals a better error message: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0a1cb80ba69afe0e88b47fda7fd11983
— Reply to this email directly, view it on GitHub https://github.com/rust-lang/rust/issues/107683#issuecomment-1418719248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYWFZPDLO7PC6TNE6Y5SR3LWWC3NTANCNFSM6AAAAAAURV7JEI . You are receiving this because you authored the thread.Message ID: @.***>
-- Alon Levy Software Developer Greenvibe 054-2395317
Code
Current output
Desired output
Rationale and extra context
This happened to me when originally "importer.rs" contained S, and I refactored by moving S into "definer.rs", but forgot to remove the import.
The error message was confusing, although it did point to the right area (the struct S).
This happens with a recent nightly:
rustc 1.69.0-nightly (1e225413a 2023-01-28)
Other cases
No response
Anything else?
No response