You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pub(in path) error message is very unergonomic when it comes to paths that don't exist, or don't exist yet. Take this example, its how the error was intented:
pubmod baa {}pubmod boo {pub(in baa)fnfoo(){}}
gives an error "visibilities can only be restricted to ancestor modules". Now take this example:
pubmod boo {pub(in baa)fnfoo(){}}pubmod baa {}
This gives an error "cannot find module baa in the crate root".
And this code:
pubmod boo {pub(in baa::baa)fnfoo(){}}
even gives an error "failed to resolve. Maybe a missing extern crate baa;?".
What should happen instead is that in the second and third case, it should output an error similar to the first one. As it seems to not know about modules declared after the code yet (see second case), adding a note to the existing error is not enough, as clearly an error "cannot find module baa in the crate root" is misleading in this case. So unless it can be taught to know modules declared after the current code, I'd suggest to have an error similar to the first case in all three cases.
The text was updated successfully, but these errors were encountered:
The pub(in path) error message is very unergonomic when it comes to paths that don't exist, or don't exist yet. Take this example, its how the error was intented:
gives an error "visibilities can only be restricted to ancestor modules". Now take this example:
This gives an error "cannot find module
baa
in the crate root".And this code:
even gives an error "failed to resolve. Maybe a missing
extern crate baa;
?".What should happen instead is that in the second and third case, it should output an error similar to the first one. As it seems to not know about modules declared after the code yet (see second case), adding a note to the existing error is not enough, as clearly an error "cannot find module
baa
in the crate root" is misleading in this case. So unless it can be taught to know modules declared after the current code, I'd suggest to have an error similar to the first case in all three cases.The text was updated successfully, but these errors were encountered: