Skip to content

Commit 798b23d

Browse files
committed
---
yaml --- r: 110227 b: refs/heads/try c: 080d210 h: refs/heads/master i: 110225: 27202e1 110223: 453e8bc v: v3
1 parent 1b7a2ae commit 798b23d

File tree

251 files changed

+1609
-2465
lines changed

Some content is hidden

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

251 files changed

+1609
-2465
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e415c25bcd81dc1f9a5a3d25d9b48ed2d545336b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c7fac4471201977fdb1c0c0a26c87287e12dc644
5-
refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
5+
refs/heads/try: 080d2104ff3b1637f919129bc40a99203a198a08
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ include config.mk
177177

178178
# Just a few macros used everywhere
179179
include $(CFG_SRC_DIR)mk/util.mk
180-
# Reconfiguring when the makefiles or submodules change
181-
include $(CFG_SRC_DIR)mk/reconfig.mk
182180
# All crates and their dependencies
183181
include $(CFG_SRC_DIR)mk/crates.mk
182+
# Reconfiguring when the makefiles or submodules change
183+
include $(CFG_SRC_DIR)mk/reconfig.mk
184184
# Various bits of setup, common macros, and top-level rules
185185
include $(CFG_SRC_DIR)mk/main.mk
186186
# C and assembly components that are not LLVM

branches/try/mk/crates.mk

Lines changed: 6 additions & 4 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
@@ -105,7 +105,8 @@ COMPILER_DOC_CRATES := rustc syntax
105105
# $(1) is the crate to generate variables for
106106
define RUST_CRATE
107107
CRATEFILE_$(1) := $$(S)src/lib$(1)/lib.rs
108-
RSINPUTS_$(1) := $$(call rwildcard,$(S)src/lib$(1)/,*.rs)
108+
RSINPUTS_$(1) := $$(wildcard $$(addprefix $(S)src/lib$(1), \
109+
*.rs */*.rs */*/*.rs */*/*/*.rs))
109110
RUST_DEPS_$(1) := $$(filter-out native:%,$$(DEPS_$(1)))
110111
NATIVE_DEPS_$(1) := $$(patsubst native:%,%,$$(filter native:%,$$(DEPS_$(1))))
111112
endef
@@ -116,7 +117,8 @@ $(foreach crate,$(CRATES),$(eval $(call RUST_CRATE,$(crate))))
116117
#
117118
# $(1) is the crate to generate variables for
118119
define RUST_TOOL
119-
TOOL_INPUTS_$(1) := $$(call rwildcard,$$(dir $$(TOOL_SOURCE_$(1))),*.rs)
120+
TOOL_INPUTS_$(1) := $$(wildcard $$(addprefix $$(dir $$(TOOL_SOURCE_$(1))), \
121+
*.rs */*.rs */*/*.rs */*/*/*.rs))
120122
endef
121123

122124
$(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))

branches/try/mk/rt.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ $$(LIBUV_DIR_$(1))/Release/libuv.a: $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) \
215215
BUILDTYPE=Release \
216216
NO_LOAD="$$(LIBUV_NO_LOAD)" \
217217
V=$$(VERBOSE)
218+
$$(Q)touch $$@
218219

219220
endif
220221

branches/try/src/compiletest/compiletest.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ pub mod common;
4343
pub mod errors;
4444

4545
#[start]
46-
fn start(argc: int, argv: **u8) -> int {
47-
green::start(argc, argv, rustuv::event_loop, main)
48-
}
46+
fn start(argc: int, argv: **u8) -> int { green::start(argc, argv, main) }
4947

5048
pub fn main() {
5149
let args = os::args();

branches/try/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

branches/try/src/doc/guide-lifetimes.md

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -559,14 +559,9 @@ points at a static constant).
559559

560560
# Named lifetimes
561561

562-
Lifetimes can be named and referenced. For example, the special lifetime
563-
`'static`, which does not go out of scope, can be used to create global
564-
variables and communicate between tasks (see the manual for usecases).
565-
566-
## Parameter Lifetimes
567-
568-
Named lifetimes allow for grouping of parameters by lifetime.
569-
For example, consider this function:
562+
Let's look at named lifetimes in more detail. Named lifetimes allow
563+
for grouping of parameters by lifetime. For example, consider this
564+
function:
570565

571566
~~~
572567
# struct Point {x: f64, y: f64}; // as before
@@ -660,25 +655,6 @@ fn select<'r, T>(shape: &Shape, threshold: f64,
660655

661656
This is equivalent to the previous definition.
662657

663-
## Labeled Control Structures
664-
665-
Named lifetime notation can also be used to control the flow of execution:
666-
667-
~~~
668-
'h: for i in range(0,10) {
669-
'g: loop {
670-
if i % 2 == 0 { continue 'h; }
671-
if i == 9 { break 'h; }
672-
break 'g;
673-
}
674-
}
675-
~~~
676-
677-
> ***Note:*** Labelled breaks are not currently supported within `while` loops.
678-
679-
Named labels are hygienic and can be used safely within macros.
680-
See the macros guide section on hygiene for more details.
681-
682658
# Conclusion
683659

684660
So there you have it: a (relatively) brief tour of the lifetime

branches/try/src/doc/guide-macros.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -398,38 +398,6 @@ position (in particular, not as an argument to yet another macro invocation),
398398
the expander will then proceed to evaluate `m2!()` (along with any other macro
399399
invocations `m1!(m2!())` produced).
400400

401-
# Hygiene
402-
403-
To prevent clashes, rust implements
404-
[hygienic macros](http://en.wikipedia.org/wiki/Hygienic_macro).
405-
406-
As an example, `loop` and `for-loop` labels (discussed in the lifetimes guide)
407-
will not clash. The following code will print "Hello!" only once:
408-
409-
~~~
410-
#[feature(macro_rules)];
411-
412-
macro_rules! loop_x (
413-
($e: expr) => (
414-
// $e will not interact with this 'x
415-
'x: loop {
416-
println!("Hello!");
417-
$e
418-
}
419-
);
420-
)
421-
422-
fn main() {
423-
'x: loop {
424-
loop_x!(break 'x);
425-
println!("I am never printed.");
426-
}
427-
}
428-
~~~
429-
430-
The two `'x` names did not clash, which would have caused the loop
431-
to print "I am never printed" and to run forever.
432-
433401
# A final note
434402

435403
Macros, as currently implemented, are not for the faint of heart. Even

branches/try/src/doc/guide-runtime.md

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -223,49 +223,27 @@ Having a default decision made in the compiler is done out of necessity and
223223
convenience. The compiler's decision of runtime to link to is *not* an
224224
endorsement of one over the other. As always, this decision can be overridden.
225225

226-
For example, this program will be linked to "the default runtime". The current
227-
default runtime is to use libnative.
226+
For example, this program will be linked to "the default runtime"
228227

229228
~~~{.rust}
230229
fn main() {}
231230
~~~
232231

233-
### Force booting with libgreen
234-
235-
In this example, the `main` function will be booted with I/O support powered by
236-
libuv. This is done by linking to the `rustuv` crate and specifying the
237-
`rustuv::event_loop` function as the event loop factory.
238-
239-
To create a pool of green tasks which have no I/O support, you may shed the
240-
`rustuv` dependency and use the `green::basic::event_loop` function instead of
241-
`rustuv::event_loop`. All tasks will have no I/O support, but they will still be
242-
able to deschedule/reschedule (use channels, locks, etc).
232+
Whereas this program explicitly opts into using a particular runtime
243233

244234
~~~{.rust}
245235
extern crate green;
246-
extern crate rustuv;
247236
248237
#[start]
249238
fn start(argc: int, argv: **u8) -> int {
250-
green::start(argc, argv, rustuv::event_loop, main)
239+
green::start(argc, argv, main)
251240
}
252241
253242
fn main() {}
254243
~~~
255244

256-
### Force booting with libnative
257-
258-
This program's `main` function will always be booted with libnative, running
259-
inside of an OS thread.
260-
261-
~~~{.rust}
262-
extern crate native;
263-
264-
#[start]
265-
fn start(argc: int, argv: **u8) -> int { native::start(argc, argv, main) }
266-
267-
fn main() {}
268-
~~~
245+
Both libgreen/libnative provide a top-level `start` function which is used to
246+
boot an initial Rust task in that specified runtime.
269247

270248
# Finding the runtime
271249

branches/try/src/doc/guide-unsafe.md

Lines changed: 1 addition & 2 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

branches/try/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)

branches/try/src/doc/rust.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,13 +1471,11 @@ with the exception that they may not have a body
14711471
and are instead terminated by a semicolon.
14721472

14731473
~~~~
1474-
extern crate libc;
1475-
use libc::{c_char, FILE};
1474+
# use std::libc::{c_char, FILE};
14761475
14771476
extern {
14781477
fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
14791478
}
1480-
# fn main() {}
14811479
~~~~
14821480

14831481
Functions within external blocks may be called by Rust code,

branches/try/src/doc/tutorial.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,8 +2103,7 @@ a `&T` pointer. `MutexArc` is an example of a *sharable* type with internal muta
21032103
These are types that do not contain any data whose lifetime is bound to
21042104
a particular stack frame. These are types that do not contain any
21052105
references, or types where the only contained references
2106-
have the `'static` lifetime. (For more on named lifetimes and their uses,
2107-
see the [references and lifetimes guide][lifetimes].)
2106+
have the `'static` lifetime.
21082107
21092108
> ***Note:*** These two traits were referred to as 'kinds' in earlier
21102109
> iterations of the language, and often still are.
@@ -2430,25 +2429,23 @@ select the method to call at runtime.
24302429
24312430
This usage of traits is similar to Java interfaces.
24322431
2433-
There are some built-in bounds, such as `Send` and `Share`, which are properties
2434-
of the components of types. By design, trait objects don't know the exact type
2435-
of their contents and so the compiler cannot reason about those properties.
2432+
By default, each of the three storage classes for traits enforce a
2433+
particular set of built-in kinds that their contents must fulfill in
2434+
order to be packaged up in a trait object of that storage class.
24362435
2437-
You can instruct the compiler, however, that the contents of a trait object must
2438-
acribe to a particular bound with a trailing colon (`:`). These are examples of
2439-
valid types:
2436+
* The contents of owned traits (`~Trait`) must fulfill the `Send` bound.
2437+
* The contents of reference traits (`&Trait`) are not constrained by any bound.
24402438
2441-
~~~rust
2442-
trait Foo {}
2443-
trait Bar<T> {}
2439+
Consequently, the trait objects themselves automatically fulfill their
2440+
respective kind bounds. However, this default behavior can be overridden by
2441+
specifying a list of bounds on the trait type, for example, by writing `~Trait:`
2442+
(which indicates that the contents of the owned trait need not fulfill any
2443+
bounds), or by writing `~Trait:Send+Share`, which indicates that in addition
2444+
to fulfilling `Send`, contents must also fulfill `Share`, and as a consequence,
2445+
the trait itself fulfills `Share`.
24442446
2445-
fn sendable_foo(f: ~Foo:Send) { /* ... */ }
2446-
fn shareable_bar<T: Share>(b: &Bar<T>: Share) { /* ... */ }
2447-
~~~
2448-
2449-
When no colon is specified (such as the type `~Foo`), it is inferred that the
2450-
value ascribes to no bounds. They must be added manually if any bounds are
2451-
necessary for usage.
2447+
* `~Trait:Send` is equivalent to `~Trait`.
2448+
* `&Trait:` is equivalent to `&Trait`.
24522449
24532450
Builtin kind bounds can also be specified on closure types in the same way (for
24542451
example, by writing `fn:Send()`), and the default behaviours are the same as

branches/try/src/etc/zsh/_rust

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ _rustc_opts_switches=(
4040
)
4141
_rustc_opts_lint=(
4242
'attribute-usage[detects bad use of attributes]'
43-
'ctypes[proper use of libc types in foreign modules]'
43+
'ctypes[proper use of std::libc types in foreign modules]'
4444
'dead-assignment[detect assignments that will never be read]'
4545
'dead-code[detect piece of code that will never be used]'
4646
'default-type-param-usage[prevents explicitly setting a type parameter with a default]'

branches/try/src/libcollections/dlist.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,16 +582,16 @@ impl<A> DoubleEndedIterator<A> for MoveItems<A> {
582582
}
583583

584584
impl<A> FromIterator<A> for DList<A> {
585-
fn from_iterator<T: Iterator<A>>(iterator: T) -> DList<A> {
585+
fn from_iterator<T: Iterator<A>>(iterator: &mut T) -> DList<A> {
586586
let mut ret = DList::new();
587587
ret.extend(iterator);
588588
ret
589589
}
590590
}
591591

592592
impl<A> Extendable<A> for DList<A> {
593-
fn extend<T: Iterator<A>>(&mut self, mut iterator: T) {
594-
for elt in iterator { self.push_back(elt); }
593+
fn extend<T: Iterator<A>>(&mut self, iterator: &mut T) {
594+
for elt in *iterator { self.push_back(elt); }
595595
}
596596
}
597597

0 commit comments

Comments
 (0)