Skip to content
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

docs: Describe core injection correctly in tutorial #5663

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2561,12 +2561,18 @@ types. Methods on [vectors] and [strings], implementations of most
comparison and math operators, and pervasive types like [`Option`]
and [`Result`] live in core.

All Rust programs link to the core library and import its contents,
All Rust programs link to the core library,
as if the following were written at the top of the crate.

~~~ {.xfail-test}
extern mod core;
use core::*;
~~~

As with any other library,
Rust programs must explicitly import names in `core`:

~~~ {.xfail-test}
use core::cmp::{Eq, Ord};
~~~

[core]: core/index.html
Expand Down