From 8cb12fdfe70732302e7c79790fd17179e1e1d42a Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 1 Apr 2013 14:19:16 -0700 Subject: [PATCH] docs: Describe core injection correctly in tutorial --- doc/tutorial.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 874383097db5a..d5548ee93f8ff 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -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