Skip to content

Commit d49d0f8

Browse files
committed
auto merge of #6704 : tedhorst/rust/rename_lib_fixes, r=graydon
This passes make check now.
2 parents 6e2b082 + 34cfd21 commit d49d0f8

File tree

7 files changed

+148
-146
lines changed

7 files changed

+148
-146
lines changed

doc/rust.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ This document does not serve as a tutorial introduction to the
1717
language. Background familiarity with the language is assumed. A separate
1818
[tutorial] document is available to help acquire such background familiarity.
1919

20-
This document also does not serve as a reference to the [core] or [standard]
20+
This document also does not serve as a reference to the [standard] or [extra]
2121
libraries included in the language distribution. Those libraries are
2222
documented separately by extracting documentation attributes from their
2323
source code.
2424

2525
[tutorial]: tutorial.html
26-
[core]: core/index.html
2726
[standard]: std/index.html
27+
[extra]: extra/index.html
2828

2929
## Disclaimer
3030

@@ -441,7 +441,7 @@ expression context, the final namespace qualifier is omitted.
441441
Two examples of paths with type arguments:
442442

443443
~~~~
444-
# use core::hashmap::HashMap;
444+
# use std::hashmap::HashMap;
445445
# fn f() {
446446
# fn id<T:Copy>(t: T) -> T { t }
447447
type t = HashMap<int,~str>; // Type arguments used in a type expression
@@ -768,9 +768,9 @@ Three examples of `extern mod` declarations:
768768
~~~~~~~~{.xfail-test}
769769
extern mod pcre (uuid = "54aba0f8-a7b1-4beb-92f1-4cf625264841");
770770
771-
extern mod std; // equivalent to: extern mod std ( name = "std" );
771+
extern mod extra; // equivalent to: extern mod extra ( name = "extra" );
772772
773-
extern mod ruststd (name = "std"); // linking to 'std' under another name
773+
extern mod rustextra (name = "extra"); // linking to 'extra' under another name
774774
~~~~~~~~
775775

776776
##### Use declarations
@@ -802,19 +802,19 @@ Use declarations support a number of convenient shortcuts:
802802
An example of `use` declarations:
803803

804804
~~~~
805-
use core::float::sin;
806-
use core::str::{slice, contains};
807-
use core::option::Some;
805+
use std::float::sin;
806+
use std::str::{slice, contains};
807+
use std::option::Some;
808808
809809
fn main() {
810-
// Equivalent to 'info!(core::float::sin(1.0));'
810+
// Equivalent to 'info!(std::float::sin(1.0));'
811811
info!(sin(1.0));
812812
813-
// Equivalent to 'info!(core::option::Some(1.0));'
813+
// Equivalent to 'info!(std::option::Some(1.0));'
814814
info!(Some(1.0));
815815
816816
// Equivalent to
817-
// 'info!(core::str::contains(core::str::slice("foo", 0, 1), "oo"));'
817+
// 'info!(std::str::contains(std::str::slice("foo", 0, 1), "oo"));'
818818
info!(contains(slice("foo", 0, 1), "oo"));
819819
}
820820
~~~~
@@ -1327,7 +1327,7 @@ with the exception that they may not have a body
13271327
and are instead terminated by a semicolon.
13281328

13291329
~~~
1330-
# use core::libc::{c_char, FILE};
1330+
# use std::libc::{c_char, FILE};
13311331
# #[nolink]
13321332
13331333
extern {
@@ -1436,7 +1436,7 @@ Some primitive Rust operations are defined in Rust code,
14361436
rather than being implemented directly in C or assembly language.
14371437
The definitions of these operations have to be easy for the compiler to find.
14381438
The `lang` attribute makes it possible to declare these operations.
1439-
For example, the `str` module in the Rust core library defines the string equality function:
1439+
For example, the `str` module in the Rust standard library defines the string equality function:
14401440

14411441
~~~ {.xfail-test}
14421442
#[lang="str_eq"]
@@ -1562,7 +1562,7 @@ impl<T: Eq> Eq for Foo<T> {
15621562
Supported traits for `deriving` are:
15631563

15641564
* Comparison traits: `Eq`, `TotalEq`, `Ord`, `TotalOrd`.
1565-
* Serialization: `Encodable`, `Decodable`. These require `std`.
1565+
* Serialization: `Encodable`, `Decodable`. These require `extra`.
15661566
* `Clone` and `DeepClone`, to perform (deep) copies.
15671567
* `IterBytes`, to iterate over the bytes in a data type.
15681568
* `Rand`, to create a random instance of a data type.
@@ -1885,25 +1885,25 @@ Binary operators expressions are given in terms of
18851885
#### Arithmetic operators
18861886

18871887
Binary arithmetic expressions are syntactic sugar for calls to built-in traits,
1888-
defined in the `core::ops` module of the `core` library.
1888+
defined in the `std::ops` module of the `std` library.
18891889
This means that arithmetic operators can be overridden for user-defined types.
18901890
The default meaning of the operators on standard types is given here.
18911891

18921892
`+`
18931893
: Addition and vector/string concatenation.
1894-
Calls the `add` method on the `core::ops::Add` trait.
1894+
Calls the `add` method on the `std::ops::Add` trait.
18951895
`-`
18961896
: Subtraction.
1897-
Calls the `sub` method on the `core::ops::Sub` trait.
1897+
Calls the `sub` method on the `std::ops::Sub` trait.
18981898
`*`
18991899
: Multiplication.
1900-
Calls the `mul` method on the `core::ops::Mul` trait.
1900+
Calls the `mul` method on the `std::ops::Mul` trait.
19011901
`/`
19021902
: Quotient.
1903-
Calls the `div` method on the `core::ops::Div` trait.
1903+
Calls the `div` method on the `std::ops::Div` trait.
19041904
`%`
19051905
: Remainder.
1906-
Calls the `rem` method on the `core::ops::Rem` trait.
1906+
Calls the `rem` method on the `std::ops::Rem` trait.
19071907

19081908
#### Bitwise operators
19091909

@@ -1914,19 +1914,19 @@ The default meaning of the operators on standard types is given here.
19141914

19151915
`&`
19161916
: And.
1917-
Calls the `bitand` method of the `core::ops::BitAnd` trait.
1917+
Calls the `bitand` method of the `std::ops::BitAnd` trait.
19181918
`|`
19191919
: Inclusive or.
1920-
Calls the `bitor` method of the `core::ops::BitOr` trait.
1920+
Calls the `bitor` method of the `std::ops::BitOr` trait.
19211921
`^`
19221922
: Exclusive or.
1923-
Calls the `bitxor` method of the `core::ops::BitXor` trait.
1923+
Calls the `bitxor` method of the `std::ops::BitXor` trait.
19241924
`<<`
19251925
: Logical left shift.
1926-
Calls the `shl` method of the `core::ops::Shl` trait.
1926+
Calls the `shl` method of the `std::ops::Shl` trait.
19271927
`>>`
19281928
: Logical right shift.
1929-
Calls the `shr` method of the `core::ops::Shr` trait.
1929+
Calls the `shr` method of the `std::ops::Shr` trait.
19301930

19311931
#### Lazy boolean operators
19321932

@@ -1947,22 +1947,22 @@ The default meaning of the operators on standard types is given here.
19471947

19481948
`==`
19491949
: Equal to.
1950-
Calls the `eq` method on the `core::cmp::Eq` trait.
1950+
Calls the `eq` method on the `std::cmp::Eq` trait.
19511951
`!=`
19521952
: Unequal to.
1953-
Calls the `ne` method on the `core::cmp::Eq` trait.
1953+
Calls the `ne` method on the `std::cmp::Eq` trait.
19541954
`<`
19551955
: Less than.
1956-
Calls the `lt` method on the `core::cmp::Ord` trait.
1956+
Calls the `lt` method on the `std::cmp::Ord` trait.
19571957
`>`
19581958
: Greater than.
1959-
Calls the `gt` method on the `core::cmp::Ord` trait.
1959+
Calls the `gt` method on the `std::cmp::Ord` trait.
19601960
`<=`
19611961
: Less than or equal.
1962-
Calls the `le` method on the `core::cmp::Ord` trait.
1962+
Calls the `le` method on the `std::cmp::Ord` trait.
19631963
`>=`
19641964
: Greater than or equal.
1965-
Calls the `ge` method on the `core::cmp::Ord` trait.
1965+
Calls the `ge` method on the `std::cmp::Ord` trait.
19661966

19671967

19681968
#### Type cast expressions
@@ -2121,11 +2121,11 @@ then the expression completes.
21212121
Some examples of call expressions:
21222122

21232123
~~~~
2124-
# use core::from_str::FromStr::from_str;
2124+
# use std::from_str::FromStr;
21252125
# fn add(x: int, y: int) -> int { 0 }
21262126
21272127
let x: int = add(1, 2);
2128-
let pi = from_str::<f32>("3.14");
2128+
let pi = FromStr::from_str::<f32>("3.14");
21292129
~~~~
21302130

21312131
### Lambda expressions
@@ -3168,7 +3168,7 @@ execute, after which it is *descheduled* at a loop-edge or similar
31683168
preemption point, and another task within is scheduled, pseudo-randomly.
31693169

31703170
An executing task can yield control at any time, by making a library call to
3171-
`core::task::yield`, which deschedules it immediately. Entering any other
3171+
`std::task::yield`, which deschedules it immediately. Entering any other
31723172
non-executing state (blocked, dead) similarly deschedules the task.
31733173

31743174

@@ -3181,7 +3181,7 @@ run-time. It is smaller and simpler than many modern language runtimes. It is
31813181
tightly integrated into the language's execution model of memory, tasks,
31823182
communication and logging.
31833183

3184-
> **Note:** The runtime library will merge with the `core` library in future versions of Rust.
3184+
> **Note:** The runtime library will merge with the `std` library in future versions of Rust.
31853185
31863186
### Memory allocation
31873187

doc/tutorial-ffi.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The following is a minimal example of calling a foreign function which will comp
1212
installed:
1313

1414
~~~~ {.xfail-test}
15-
use core::libc::size_t;
15+
use std::libc::size_t;
1616
1717
#[link_args = "-lsnappy"]
1818
extern {
@@ -42,7 +42,7 @@ runtime.
4242
The `extern` block can be extended to cover the entire snappy API:
4343

4444
~~~~ {.xfail-test}
45-
use core::libc::{c_int, size_t};
45+
use std::libc::{c_int, size_t};
4646
4747
#[link_args = "-lsnappy"]
4848
extern {
@@ -149,9 +149,9 @@ A type with the same functionality as owned boxes can be implemented by
149149
wrapping `malloc` and `free`:
150150

151151
~~~~
152-
use core::libc::{c_void, size_t, malloc, free};
153-
use core::unstable::intrinsics;
154-
use core::util;
152+
use std::libc::{c_void, size_t, malloc, free};
153+
use std::unstable::intrinsics;
154+
use std::util;
155155
156156
// a wrapper around the handle returned by the foreign code
157157
pub struct Unique<T> {
@@ -161,7 +161,7 @@ pub struct Unique<T> {
161161
pub impl<T: Owned> Unique<T> {
162162
fn new(value: T) -> Unique<T> {
163163
unsafe {
164-
let ptr = malloc(core::sys::size_of::<T>() as size_t) as *mut T;
164+
let ptr = malloc(std::sys::size_of::<T>() as size_t) as *mut T;
165165
assert!(!ptr::is_null(ptr));
166166
// `*ptr` is uninitialized, and `*ptr = value` would attempt to destroy it
167167
intrinsics::move_val_init(&mut *ptr, value);

0 commit comments

Comments
 (0)