-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error message suggests using core
when it ought to suggest using std
#23355
Comments
Tempted to close this as a dupe of #23224. |
Such a hack will probably not be implemented. |
@arielb1 I as well don't think it's likely, merely a possibility. :P I also think this is a much bigger pain point for beginners than most people realize. The only reason why I'm suggesting an ugly hack at all is because this must be addressed before libcore hits stable, and its FCP will be coming to a close any day now. |
Why does this need to be addressed? |
@arielb1 I was under the impression that using any API from core directly required a feature flag and hence was only possible on nightly, but I've just experimented and determined that's not the case. So I suppose stabilizing core at this point won't make us any worse off regarding this issue. |
diagnostics: make paths to external items more visible This PR changes the reported path for an external item so that it is visible from at least one local module (i.e. it does not use any inaccessible external modules) if possible. If the external item's crate was declared with an `extern crate`, the path is guarenteed to use the `extern crate`. Fixes #23224, fixes #23355, fixes #26635, fixes #27165. r? @nrc
Program:
Output:
Note that it suggests
core::iter::FromIterator
when it could be suggestingstd::iter::FromIterator
. Should a user follow this advice, they would need to also link libcore viaextern crate core
, which (IIRC) means that they will be opting out of 1.0-stable thanks to core's intentional lack of stability.I don't know if it's worth nominating, but this is definitely a backcompat hazard for users.
The text was updated successfully, but these errors were encountered: