Explicitly using extern crate
in documentation examples gives unhelpful error
#27301
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
T-dev-tools
Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
This would be more an enhancement than anything, but say if you have a library
bignum
and wanted to write an example in your docsThe error I made initially was I didn't know
extern crate bignum
is implicit, but the compiler errors I generated were what led me on a goose hunt. If I tried to compile this withcargo test
I would getSo I followed the errors advice, changing that statement but instead got?
which leads you to the final error
Maybe in the future it would be useful to instead tell the user
extern crate bignum
is implicit? I spent a good while digging around before I realized my silly mistake, but the errors didn't seem lead me in any helpful direction.The text was updated successfully, but these errors were encountered: