Skip to content

Commit 8523feb

Browse files
committed
---
yaml --- r: 109982 b: refs/heads/master c: b78ac5b h: refs/heads/master v: v3
1 parent 9f8e622 commit 8523feb

File tree

287 files changed

+1614
-1942
lines changed

Some content is hidden

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

287 files changed

+1614
-1942
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 4af69f204e2365da0dc9f32bbd0eb3201dc9a9e0
2+
refs/heads/master: b78ac5b74a62e7b2772d322004a6bb04967f8437
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c7fac4471201977fdb1c0c0a26c87287e12dc644
55
refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d

trunk/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ documentation.
55

66
## Quick Start
77

8-
1. Download a [binary installer][installer] for your platform.
8+
1. Download a [binary insaller][installer] for your platform.
99
2. Read the [tutorial].
1010
3. Enjoy!
1111

trunk/mk/crates.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
52+
TARGET_CRATES := std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
5454
workcache url log
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

59-
DEPS_std := libc native:rustrt native:compiler-rt native:backtrace
59+
DEPS_std := native:rustrt native:compiler-rt native:backtrace
6060
DEPS_green := std rand native:context_switch
6161
DEPS_rustuv := std native:uv native:uv_support
6262
DEPS_native := std

trunk/mk/dist.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
215215
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
216216
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
217217
dist-install-dir-$(1): PREPARE_CLEAN=true
218-
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
218+
dist-install-dir-$(1): prepare-base-dir-$(1)
219219
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
220220
> tmp/dist/manifest-$(1).in
221221
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
@@ -224,7 +224,6 @@ dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
224224
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
225225
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
226226
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
227-
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
228227
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
229228

230229
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)

trunk/mk/tests.mk

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ $(foreach host,$(CFG_HOST), \
370370
define DEF_TEST_CRATE_RULES
371371
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
372372

373+
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
374+
373375
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
374376
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
375377
@$$(call E, run: $$<)
@@ -501,10 +503,6 @@ CTEST_BUILD_BASE_codegen = codegen
501503
CTEST_MODE_codegen = codegen
502504
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
503505

504-
# CTEST_DISABLE_$(TEST_GROUP), if set, will cause the test group to be
505-
# disabled and the associated message to be printed as a warning
506-
# during attempts to run those tests.
507-
508506
ifeq ($(CFG_GDB),)
509507
CTEST_DISABLE_debuginfo = "no gdb found"
510508
endif
@@ -517,14 +515,6 @@ ifeq ($(CFG_OSTYPE),apple-darwin)
517515
CTEST_DISABLE_debuginfo = "gdb on darwing needs root"
518516
endif
519517

520-
# CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
521-
# test group to be disabled *unless* the target is able to build a
522-
# compiler (i.e. when the target triple is in the set of of host
523-
# triples). The associated message will be printed as a warning
524-
# during attempts to run those tests.
525-
526-
CTEST_DISABLE_NONSELFHOST_rpass-full = "run-pass-full suite is unavailable when cross-compiling."
527-
528518
define DEF_CTEST_VARS
529519

530520
# All the per-stage build rules you might want to call from the
@@ -570,7 +560,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
570560
$$(CTEST_TESTARGS)
571561

572562
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
573-
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(2)_H_$(3))
563+
CTEST_DEPS_rpass_full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
574564
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
575565
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
576566
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
@@ -597,28 +587,8 @@ CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
597587

598588
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
599589

600-
# CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)
601-
# Goal: leave this variable as empty string if we should run the test.
602-
# Otherwise, set it to the reason we are not running the test.
603-
# (Encoded as a separate variable because GNU make does not have a
604-
# good way to express OR on ifeq commands)
590+
ifeq ($$(CTEST_DISABLE_$(4)),)
605591

606-
ifneq ($$(CTEST_DISABLE_$(4)),)
607-
# Test suite is disabled for all configured targets.
608-
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_$(4))
609-
else
610-
# else, check if non-self-hosted target (i.e. target not-in hosts) ...
611-
ifeq ($$(findstring $(2),$$(CFG_HOST)),)
612-
# ... if so, then check if this test suite is disabled for non-selfhosts.
613-
ifneq ($$(CTEST_DISABLE_NONSELFHOST_$(4)),)
614-
# Test suite is disabled for this target.
615-
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_NONSELFHOST_$(4))
616-
endif
617-
endif
618-
# Neither DISABLE nor DISABLE_NONSELFHOST is set ==> okay, run the test.
619-
endif
620-
621-
ifeq ($$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)),)
622592
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
623593
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
624594
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
@@ -630,9 +600,11 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
630600

631601
else
632602

633-
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)):
603+
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
604+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
605+
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
634606
@$$(call E, run $(4) [$(2)]: $$<)
635-
@$$(call E, warning: tests disabled: $$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)))
607+
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
636608
touch $$@
637609

638610
endif

trunk/src/compiletest/compiletest.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#![crate_type = "bin"]
1212
#![feature(phase)]
1313

14-
// we use our own (green) start below; do not link in libnative; issue #13247.
15-
#![no_start]
16-
1714
#![allow(non_camel_case_types)]
1815
#![deny(warnings)]
1916

trunk/src/doc/guide-ffi.md

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

1414
~~~~ {.ignore}
15-
extern crate libc;
16-
use libc::size_t;
15+
use std::libc::size_t;
1716
1817
#[link(name = "snappy")]
1918
extern {
@@ -45,8 +44,7 @@ keeping the binding correct at runtime.
4544
The `extern` block can be extended to cover the entire snappy API:
4645

4746
~~~~ {.ignore}
48-
extern crate libc;
49-
use libc::{c_int, size_t};
47+
use std::libc::{c_int, size_t};
5048
5149
#[link(name = "snappy")]
5250
extern {
@@ -404,7 +402,7 @@ global state. In order to access these variables, you declare them in `extern`
404402
blocks with the `static` keyword:
405403

406404
~~~{.ignore}
407-
extern crate libc;
405+
use std::libc;
408406
409407
#[link(name = "readline")]
410408
extern {
@@ -422,7 +420,7 @@ interface. To do this, statics can be declared with `mut` so rust can mutate
422420
them.
423421

424422
~~~{.ignore}
425-
extern crate libc;
423+
use std::libc;
426424
use std::ptr;
427425
428426
#[link(name = "readline")]
@@ -446,15 +444,11 @@ calling foreign functions. Some foreign functions, most notably the Windows API,
446444
conventions. Rust provides a way to tell the compiler which convention to use:
447445

448446
~~~~
449-
extern crate libc;
450-
451447
#[cfg(target_os = "win32", target_arch = "x86")]
452448
#[link(name = "kernel32")]
453449
extern "stdcall" {
454-
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> libc::c_int;
450+
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> std::libc::c_int;
455451
}
456-
457-
# fn main() { }
458452
~~~~
459453

460454
This applies to the entire `extern` block. The list of supported ABI constraints

trunk/src/doc/guide-unsafe.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ As an example, we give a reimplementation of owned boxes by wrapping
192192
reimplementation is as safe as the built-in `~` type.
193193

194194
```
195-
extern crate libc;
196-
use libc::{c_void, size_t, malloc, free};
195+
use std::libc::{c_void, size_t, malloc, free};
197196
use std::mem;
198197
use std::ptr;
199198
@@ -295,7 +294,7 @@ asm!(assembly template
295294
);
296295
```
297296

298-
Any use of `asm` is feature gated (requires `#![feature(asm)]` on the
297+
Any use of `asm` is feature gated (requires `#[feature(asm)];` on the
299298
crate to allow) and of course requires an `unsafe` block.
300299

301300
> **Note**: the examples here are given in x86/x86-64 assembly, but all
@@ -307,7 +306,7 @@ The `assembly template` is the only required parameter and must be a
307306
literal string (i.e `""`)
308307

309308
```
310-
#![feature(asm)]
309+
#[feature(asm)];
311310
312311
#[cfg(target_arch = "x86")]
313312
#[cfg(target_arch = "x86_64")]
@@ -335,7 +334,7 @@ Output operands, input operands, clobbers and options are all optional
335334
but you must add the right number of `:` if you skip them:
336335

337336
```
338-
# #![feature(asm)]
337+
# #[feature(asm)];
339338
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
340339
# fn main() { unsafe {
341340
asm!("xor %eax, %eax"
@@ -349,7 +348,7 @@ asm!("xor %eax, %eax"
349348
Whitespace also doesn't matter:
350349

351350
```
352-
# #![feature(asm)]
351+
# #[feature(asm)];
353352
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
354353
# fn main() { unsafe {
355354
asm!("xor %eax, %eax" ::: "eax");
@@ -363,7 +362,7 @@ Input and output operands follow the same format: `:
363362
expressions must be mutable lvalues:
364363

365364
```
366-
# #![feature(asm)]
365+
# #[feature(asm)];
367366
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
368367
fn add(a: int, b: int) -> int {
369368
let mut c = 0;
@@ -391,7 +390,7 @@ compiler not to assume any values loaded into those registers will
391390
stay valid.
392391

393392
```
394-
# #![feature(asm)]
393+
# #[feature(asm)];
395394
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
396395
# fn main() { unsafe {
397396
// Put the value 0x200 in eax

trunk/src/doc/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ li {list-style-type: none; }
3636
* [The `glob` file path matching library](glob/index.html)
3737
* [The `green` M:N runtime library](green/index.html)
3838
* [The `hexfloat` library for hexadecimal floating-point literals](hexfloat/index.html)
39-
* [The `libc` bindings](libc/index.html)
4039
* [The `native` 1:1 threading runtime](native/index.html)
4140
* [The `num` arbitrary precision numerics library](num/index.html)
4241
* [The `rand` library for random numbers and distributions](rand/index.html)

trunk/src/doc/po/ja/rust.md.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Japanese translations for Rust package
2-
# Copyright (C) 2013-2014 The Rust Project Developers
2+
# Copyright (C) 2013 The Rust Project Developers
33
# This file is distributed under the same license as the Rust package.
44
# Automatically generated, 2013.
55
#
@@ -886,7 +886,7 @@ msgstr ""
886886
#: src/doc/rust.md:2008
887887
#, fuzzy
888888
#| msgid "~~~~ use std::task::spawn;"
889-
msgid "~~~~ {.ignore} #![warn(unstable)]"
889+
msgid "~~~~ {.ignore} #[warn(unstable)];"
890890
msgstr ""
891891
"~~~~\n"
892892
"use std::task::spawn;"

trunk/src/doc/rust.md

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,13 @@ The keywords are the following strings:
206206
as
207207
break
208208
crate
209+
do
209210
else enum extern
210211
false fn for
211212
if impl in
212213
let loop
213214
match mod mut
214-
priv proc pub
215+
priv pub
215216
ref return
216217
self static struct super
217218
true trait type
@@ -1471,13 +1472,11 @@ with the exception that they may not have a body
14711472
and are instead terminated by a semicolon.
14721473

14731474
~~~~
1474-
extern crate libc;
1475-
use libc::{c_char, FILE};
1475+
# use std::libc::{c_char, FILE};
14761476
14771477
extern {
14781478
fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
14791479
}
1480-
# fn main() {}
14811480
~~~~
14821481

14831482
Functions within external blocks may be called by Rust code,
@@ -2559,12 +2558,12 @@ task in a _failing state_.
25592558

25602559
~~~~ {.ignore}
25612560
# use std::task;
2562-
# task::spawn(proc() {
2561+
# do task::spawn {
25632562
25642563
([1, 2, 3, 4])[0];
25652564
(["a", "b"])[10]; // fails
25662565
2567-
# })
2566+
# }
25682567
~~~~
25692568

25702569
### Unary operator expressions
@@ -3422,21 +3421,8 @@ x = bo(5,7);
34223421

34233422
### Closure types
34243423

3425-
~~~~ {.notrust .ebnf .notation}
3426-
closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
3427-
[ ':' bound-list ] [ '->' type ]
3428-
procedure_type := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
3429-
[ ':' bound-list ] [ '->' type ]
3430-
lifetime-list := lifetime | lifetime ',' lifetime-list
3431-
arg-list := ident ':' type | ident ':' type ',' arg-list
3432-
bound-list := bound | bound '+' bound-list
3433-
bound := path | lifetime
3434-
~~~~
3424+
The type of a closure mapping an input of type `A` to an output of type `B` is `|A| -> B`. A closure with no arguments or return values has type `||`.
34353425

3436-
The type of a closure mapping an input of type `A` to an output of type `B` is
3437-
`|A| -> B`. A closure with no arguments or return values has type `||`.
3438-
Similarly, a procedure mapping `A` to `B` is `proc(A) -> B` and a no-argument
3439-
and no-return value closure has type `proc()`.
34403426

34413427
An example of creating and calling a closure:
34423428

@@ -3459,30 +3445,6 @@ call_closure(closure_no_args, closure_args);
34593445

34603446
```
34613447

3462-
Unlike closures, procedures may only be invoked once, but own their
3463-
environment, and are allowed to move out of their environment. Procedures are
3464-
allocated on the heap (unlike closures). An example of creating and calling a
3465-
procedure:
3466-
3467-
```rust
3468-
let string = ~"Hello";
3469-
3470-
// Creates a new procedure, passing it to the `spawn` function.
3471-
spawn(proc() {
3472-
println!("{} world!", string);
3473-
});
3474-
3475-
// the variable `string` has been moved into the previous procedure, so it is
3476-
// no longer usable.
3477-
3478-
3479-
// Create an invoke a procedure. Note that the procedure is *moved* when
3480-
// invoked, so it cannot be invoked again.
3481-
let f = proc(n: int) { n + 22 };
3482-
println!("answer: {}", f(20));
3483-
3484-
```
3485-
34863448
### Object types
34873449

34883450
Every trait item (see [traits](#traits)) defines a type with the same name as the trait.

0 commit comments

Comments
 (0)