Skip to content

Commit ff1dd44

Browse files
committed
Merge remote-tracking branch 'origin/master' into 0.11.0-release
Conflicts: src/libstd/lib.rs
2 parents aa1163b + ca2778e commit ff1dd44

File tree

715 files changed

+10840
-8689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

715 files changed

+10840
-8689
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,26 @@ documentation.
5454
When complete, `make install` will place several programs into
5555
`/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
5656
API-documentation tool.
57-
system.
5857
3. Read the [tutorial].
5958
4. Enjoy!
6059

60+
### Building on Windows
61+
62+
To easily build on windows we can use [MSYS2](http://sourceforge.net/projects/msys2/):
63+
64+
1. Grab the latest MSYS2 installer and go through the installer.
65+
2. Now from the MSYS2 terminal we want to install the mingw64 toolchain and the other
66+
tools we need.
67+
68+
$ pacman -S mingw-w64-i686-toolchain
69+
$ pacman -S base-devel
70+
71+
3. With that now start `mingw32_shell.bat` from where you installed MSYS2 (i.e. `C:\msys`).
72+
4. From there just navigate to where you have Rust's source code, configure and build it:
73+
74+
$ ./configure --build=i686-pc-mingw32
75+
$ make && make install
76+
6177
[repo]: https://github.com/rust-lang/rust
6278
[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz
6379
[tutorial]: http://doc.rust-lang.org/tutorial.html

man/rustdoc.1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ directory to load plugins from (default: /tmp/rustdoc_ng/plugins)
3838
-L --library-path <val>
3939
directory to add to crate search path
4040
.TP
41+
--html-in-header <val>
42+
file to add to <head>
43+
.TP
44+
--html-before-content <val>
45+
file to add in <body>, before content
46+
.TP
47+
--html-after-content <val>
48+
file to add in <body>, after content
49+
.TP
4150
-h, --help
4251
Print help
4352

mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ PKG_FILES := \
5454
driver \
5555
etc \
5656
$(foreach crate,$(CRATES),lib$(crate)) \
57+
libcoretest \
5758
libbacktrace \
5859
rt \
5960
rustllvm \

mk/docs.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
3535
PDF_DOCS := tutorial rust
3636

3737
RUSTDOC_DEPS_rust := doc/full-toc.inc
38-
RUSTDOC_FLAGS_rust := --markdown-in-header=doc/full-toc.inc
38+
RUSTDOC_FLAGS_rust := --html-in-header=doc/full-toc.inc
3939

4040
L10N_LANGS := ja
4141

4242
# Generally no need to edit below here.
4343

4444
# The options are passed to the documentation generators.
45-
RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
46-
--markdown-in-header=doc/favicon.inc \
47-
--markdown-after-content=doc/footer.inc \
45+
RUSTDOC_HTML_OPTS_NO_CSS = --html-before-content=doc/version_info.html \
46+
--html-in-header=doc/favicon.inc \
47+
--html-after-content=doc/footer.inc \
4848
--markdown-playground-url='http://play.rust-lang.org/'
4949

5050
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css

mk/tests.mk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
######################################################################
1515

1616
# The names of crates that must be tested
17-
TEST_TARGET_CRATES = $(TARGET_CRATES)
17+
18+
# libcore tests are in a separate crate
19+
DEPS_coretest :=
20+
$(eval $(call RUST_CRATE,coretest))
21+
22+
TEST_TARGET_CRATES = $(filter-out core,$(TARGET_CRATES)) coretest
1823
TEST_DOC_CRATES = $(DOC_CRATES)
1924
TEST_HOST_CRATES = $(HOST_CRATES)
2025
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
@@ -172,7 +177,7 @@ check-notidy: cleantmptestlogs cleantestlibs all check-stage2
172177
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
173178

174179
check-lite: cleantestlibs cleantmptestlogs \
175-
$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate)) \
180+
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
176181
check-stage2-rpass \
177182
check-stage2-rfail check-stage2-cfail check-stage2-rmake
178183
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log

src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub mod common;
4242
pub mod errors;
4343

4444
#[start]
45-
fn start(argc: int, argv: **u8) -> int {
45+
fn start(argc: int, argv: *const *const u8) -> int {
4646
green::start(argc, argv, rustuv::event_loop, main)
4747
}
4848

src/doc/guide-ffi.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ use libc::{c_int, size_t};
5050
5151
#[link(name = "snappy")]
5252
extern {
53-
fn snappy_compress(input: *u8,
53+
fn snappy_compress(input: *const u8,
5454
input_length: size_t,
5555
compressed: *mut u8,
5656
compressed_length: *mut size_t) -> c_int;
57-
fn snappy_uncompress(compressed: *u8,
57+
fn snappy_uncompress(compressed: *const u8,
5858
compressed_length: size_t,
5959
uncompressed: *mut u8,
6060
uncompressed_length: *mut size_t) -> c_int;
6161
fn snappy_max_compressed_length(source_length: size_t) -> size_t;
62-
fn snappy_uncompressed_length(compressed: *u8,
62+
fn snappy_uncompressed_length(compressed: *const u8,
6363
compressed_length: size_t,
6464
result: *mut size_t) -> c_int;
65-
fn snappy_validate_compressed_buffer(compressed: *u8,
65+
fn snappy_validate_compressed_buffer(compressed: *const u8,
6666
compressed_length: size_t) -> c_int;
6767
}
6868
# fn main() {}
@@ -82,7 +82,7 @@ the allocated memory. The length is less than or equal to the capacity.
8282
~~~~
8383
# extern crate libc;
8484
# use libc::{c_int, size_t};
85-
# unsafe fn snappy_validate_compressed_buffer(_: *u8, _: size_t) -> c_int { 0 }
85+
# unsafe fn snappy_validate_compressed_buffer(_: *const u8, _: size_t) -> c_int { 0 }
8686
# fn main() {}
8787
pub fn validate_compressed_buffer(src: &[u8]) -> bool {
8888
unsafe {
@@ -106,7 +106,7 @@ the true length after compression for setting the length.
106106
~~~~
107107
# extern crate libc;
108108
# use libc::{size_t, c_int};
109-
# unsafe fn snappy_compress(a: *u8, b: size_t, c: *mut u8,
109+
# unsafe fn snappy_compress(a: *const u8, b: size_t, c: *mut u8,
110110
# d: *mut size_t) -> c_int { 0 }
111111
# unsafe fn snappy_max_compressed_length(a: size_t) -> size_t { a }
112112
# fn main() {}
@@ -132,11 +132,11 @@ format and `snappy_uncompressed_length` will retrieve the exact buffer size requ
132132
~~~~
133133
# extern crate libc;
134134
# use libc::{size_t, c_int};
135-
# unsafe fn snappy_uncompress(compressed: *u8,
135+
# unsafe fn snappy_uncompress(compressed: *const u8,
136136
# compressed_length: size_t,
137137
# uncompressed: *mut u8,
138138
# uncompressed_length: *mut size_t) -> c_int { 0 }
139-
# unsafe fn snappy_uncompressed_length(compressed: *u8,
139+
# unsafe fn snappy_uncompressed_length(compressed: *const u8,
140140
# compressed_length: size_t,
141141
# result: *mut size_t) -> c_int { 0 }
142142
# fn main() {}
@@ -418,7 +418,7 @@ Unsafe functions, on the other hand, advertise it to the world. An unsafe functi
418418
this:
419419
420420
~~~~
421-
unsafe fn kaboom(ptr: *int) -> int { *ptr }
421+
unsafe fn kaboom(ptr: *const int) -> int { *ptr }
422422
~~~~
423423
424424
This function can only be called from an `unsafe` block or another `unsafe` function.
@@ -453,7 +453,7 @@ use std::ptr;
453453
454454
#[link(name = "readline")]
455455
extern {
456-
static mut rl_prompt: *libc::c_char;
456+
static mut rl_prompt: *const libc::c_char;
457457
}
458458
459459
fn main() {
@@ -478,7 +478,7 @@ extern crate libc;
478478
#[link(name = "kernel32")]
479479
#[allow(non_snake_case_functions)]
480480
extern "stdcall" {
481-
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> libc::c_int;
481+
fn SetEnvironmentVariableA(n: *const u8, v: *const u8) -> libc::c_int;
482482
}
483483
# fn main() { }
484484
~~~~

src/doc/guide-macros.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ macro_rules! biased_match_rec (
355355
_ => { $err }
356356
}
357357
);
358+
// Produce the requested values
358359
( binds $( $bind_res:ident ),* ) => ( ($( $bind_res ),*) )
359360
)
360361
@@ -364,7 +365,7 @@ macro_rules! biased_match (
364365
( $( ($e:expr) ~ ($p:pat) else $err:stmt ; )*
365366
binds $bind_res:ident
366367
) => (
367-
let ( $( $bind_res ),* ) = biased_match_rec!(
368+
let $bind_res = biased_match_rec!(
368369
$( ($e) ~ ($p) else $err ; )*
369370
binds $bind_res
370371
);

src/doc/guide-runtime.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ extern crate green;
245245
extern crate rustuv;
246246
247247
#[start]
248-
fn start(argc: int, argv: **u8) -> int {
248+
fn start(argc: int, argv: *const *const u8) -> int {
249249
green::start(argc, argv, rustuv::event_loop, main)
250250
}
251251
@@ -261,7 +261,9 @@ inside of an OS thread.
261261
extern crate native;
262262
263263
#[start]
264-
fn start(argc: int, argv: **u8) -> int { native::start(argc, argv, main) }
264+
fn start(argc: int, argv: *const *const u8) -> int {
265+
native::start(argc, argv, main)
266+
}
265267
266268
fn main() {}
267269
~~~

src/doc/guide-tasks.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,8 @@ the string in response. The child terminates when it receives `0`.
457457
Here is the function that implements the child task:
458458

459459
~~~
460+
#![allow(deprecated)]
461+
460462
use std::comm::DuplexStream;
461463
# fn main() {
462464
fn stringifier(channel: &DuplexStream<String, uint>) {
@@ -481,6 +483,8 @@ response itself is simply the stringified version of the received value,
481483
Here is the code for the parent task:
482484

483485
~~~
486+
#![allow(deprecated)]
487+
484488
use std::comm::duplex;
485489
# use std::task::spawn;
486490
# use std::comm::DuplexStream;

src/doc/guide-unsafe.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ let ref_2: &mut u8 = unsafe { mem::transmute(&mut *ref_1) };
7979
## Raw pointers
8080

8181
Rust offers two additional pointer types "raw pointers", written as
82-
`*T` and `*mut T`. They're an approximation of C's `const T*` and `T*`
82+
`*const T` and `*mut T`. They're an approximation of C's `const T*` and `T*`
8383
respectively; indeed, one of their most common uses is for FFI,
8484
interfacing with external C libraries.
8585

@@ -100,7 +100,7 @@ offered by the Rust language and libraries. For example, they
100100
- lack any form of lifetimes, unlike `&`, and so the compiler cannot
101101
reason about dangling pointers; and
102102
- have no guarantees about aliasing or mutability other than mutation
103-
not being allowed directly through a `*T`.
103+
not being allowed directly through a `*const T`.
104104

105105
Fortunately, they come with a redeeming feature: the weaker guarantees
106106
mean weaker restrictions. The missing restrictions make raw pointers
@@ -131,13 +131,13 @@ unsafe, and neither is converting to an integer.
131131

132132
At runtime, a raw pointer `*` and a reference pointing to the same
133133
piece of data have an identical representation. In fact, an `&T`
134-
reference will implicitly coerce to an `*T` raw pointer in safe code
134+
reference will implicitly coerce to an `*const T` raw pointer in safe code
135135
and similarly for the `mut` variants (both coercions can be performed
136-
explicitly with, respectively, `value as *T` and `value as *mut T`).
136+
explicitly with, respectively, `value as *const T` and `value as *mut T`).
137137

138-
Going the opposite direction, from `*` to a reference `&`, is not
138+
Going the opposite direction, from `*const` to a reference `&`, is not
139139
safe. A `&T` is always valid, and so, at a minimum, the raw pointer
140-
`*T` has to be a valid to a valid instance of type `T`. Furthermore,
140+
`*const T` has to be a valid to a valid instance of type `T`. Furthermore,
141141
the resulting pointer must satisfy the aliasing and mutability laws of
142142
references. The compiler assumes these properties are true for any
143143
references, no matter how they are created, and so any conversion from
@@ -149,7 +149,7 @@ The recommended method for the conversion is
149149
```
150150
let i: u32 = 1;
151151
// explicit cast
152-
let p_imm: *u32 = &i as *u32;
152+
let p_imm: *const u32 = &i as *const u32;
153153
let mut m: u32 = 2;
154154
// implicit coercion
155155
let p_mut: *mut u32 = &mut m;
@@ -256,7 +256,7 @@ impl<T: Send> Drop for Unique<T> {
256256
// Copy the object out from the pointer onto the stack,
257257
// where it is covered by normal Rust destructor semantics
258258
// and cleans itself up, if necessary
259-
ptr::read(self.ptr as *T);
259+
ptr::read(self.ptr as *const T);
260260
261261
// clean-up our allocation
262262
free(self.ptr as *mut c_void)
@@ -267,12 +267,12 @@ impl<T: Send> Drop for Unique<T> {
267267
// A comparison between the built-in `Box` and this reimplementation
268268
fn main() {
269269
{
270-
let mut x = box 5;
270+
let mut x = box 5i;
271271
*x = 10;
272272
} // `x` is freed here
273273
274274
{
275-
let mut y = Unique::new(5);
275+
let mut y = Unique::new(5i);
276276
*y.borrow_mut() = 10;
277277
} // `y` is freed here
278278
}
@@ -457,7 +457,7 @@ extern crate libc;
457457
458458
// Entry point for this program
459459
#[start]
460-
fn start(_argc: int, _argv: **u8) -> int {
460+
fn start(_argc: int, _argv: *const *const u8) -> int {
461461
0
462462
}
463463
@@ -482,7 +482,7 @@ compiler's name mangling too:
482482
extern crate libc;
483483
484484
#[no_mangle] // ensure that this symbol is called `main` in the output
485-
pub extern fn main(argc: int, argv: **u8) -> int {
485+
pub extern fn main(argc: int, argv: *const *const u8) -> int {
486486
0
487487
}
488488
@@ -540,8 +540,8 @@ use core::mem;
540540
use core::raw::Slice;
541541
542542
#[no_mangle]
543-
pub extern fn dot_product(a: *u32, a_len: u32,
544-
b: *u32, b_len: u32) -> u32 {
543+
pub extern fn dot_product(a: *const u32, a_len: u32,
544+
b: *const u32, b_len: u32) -> u32 {
545545
// Convert the provided arrays into Rust slices.
546546
// The core::raw module guarantees that the Slice
547547
// structure has the same memory layout as a &[T]
@@ -573,7 +573,7 @@ extern fn begin_unwind(args: &core::fmt::Arguments,
573573
574574
#[lang = "stack_exhausted"] extern fn stack_exhausted() {}
575575
#[lang = "eh_personality"] extern fn eh_personality() {}
576-
# #[start] fn start(argc: int, argv: **u8) -> int { 0 }
576+
# #[start] fn start(argc: int, argv: *const *const u8) -> int { 0 }
577577
# fn main() {}
578578
```
579579

@@ -595,7 +595,7 @@ standard library itself.
595595
> parts of the language may never be full specified and so details may
596596
> differ wildly between implementations (and even versions of `rustc`
597597
> itself).
598-
>
598+
>
599599
> Furthermore, this is just an overview; the best form of
600600
> documentation for specific instances of these features are their
601601
> definitions and uses in `std`.
@@ -627,7 +627,7 @@ via a declaration like
627627
extern "rust-intrinsic" {
628628
fn transmute<T, U>(x: T) -> U;
629629
630-
fn offset<T>(dst: *T, offset: int) -> *T;
630+
fn offset<T>(dst: *const T, offset: int) -> *const T;
631631
}
632632
```
633633

@@ -677,8 +677,8 @@ unsafe fn deallocate(ptr: *mut u8, _size: uint, _align: uint) {
677677
}
678678
679679
#[start]
680-
fn main(argc: int, argv: **u8) -> int {
681-
let x = box 1;
680+
fn main(argc: int, argv: *const *const u8) -> int {
681+
let x = box 1i;
682682
683683
0
684684
}

0 commit comments

Comments
 (0)