Skip to content

Commit 173e96d

Browse files
committed
---
yaml --- r: 149151 b: refs/heads/try2 c: 0465fd7 h: refs/heads/master i: 149149: a742879 149147: 954e4a1 149143: d9d2bf5 149135: 73936bf 149119: ae9fb3a v: v3
1 parent 7869453 commit 173e96d

File tree

178 files changed

+3762
-5694
lines changed

Some content is hidden

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

178 files changed

+3762
-5694
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: fb12aebbd82eb3a7673738f1ed25f428b3d67242
8+
refs/heads/try2: 0465fd7fae9caf87e2e63ee255fbb54e7a269915
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@
99
[submodule "src/gyp"]
1010
path = src/gyp
1111
url = https://github.com/rust-lang/gyp.git
12-
[submodule "src/compiler-rt"]
13-
path = src/compiler-rt
14-
url = https://github.com/rust-lang/compiler-rt.git

branches/try2/Makefile.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ endif
355355
# Prerequisites for using the stageN compiler to build target artifacts
356356
TSREQ$(1)_T_$(2)_H_$(3) = \
357357
$$(HSREQ$(1)_H_$(3)) \
358-
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a \
359-
$$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a
358+
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
360359

361360
# Prerequisites for a working stageN compiler and libraries, for a specific
362361
# target

branches/try2/mk/clean.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ clean-generic-$(2)-$(1):
5454
$(1)/rt \
5555
$(1)/test \
5656
$(1)/stage* \
57-
-type f \( \
5857
-name '*.[odasS]' -o \
5958
-name '*.so' -o \
6059
-name '*.dylib' -o \
@@ -63,7 +62,6 @@ clean-generic-$(2)-$(1):
6362
-name '*.dll' -o \
6463
-name '*.def' -o \
6564
-name '*.bc' \
66-
\) \
6765
| xargs rm -f
6866
$(Q)find $(1)\
6967
-name '*.dSYM' \
@@ -98,7 +96,6 @@ clean$(1)_T_$(2)_H_$(3): \
9896
$$(foreach crate,$$(CRATES),clean$(1)_T_$(2)_H_$(3)-lib-$$(crate)) \
9997
$$(foreach tool,$$(TOOLS),clean$(1)_T_$(2)_H_$(3)-tool-$$(tool))
10098
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
101-
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a
10299
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass_stage* # For unix
103100
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/run_pass_stage* # For windows
104101

branches/try2/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ HOST_CRATES := syntax rustc rustdoc fourcc
5555
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5656
TOOLS := compiletest rustdoc rustc
5757

58-
DEPS_std := native:rustrt native:compiler-rt
58+
DEPS_std := native:rustrt
5959
DEPS_extra := std term sync serialize getopts collections
6060
DEPS_green := std
6161
DEPS_rustuv := std native:uv native:uv_support

branches/try2/mk/install.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ install-target-$(1)-host-$(2): \
9696
$$(call INSTALL_LIB,$$(call CFG_LIB_GLOB_$(1),$$(crate)));\
9797
$$(call INSTALL_LIB,$$(call CFG_RLIB_GLOB,$$(crate)));)
9898
$$(Q)$$(call INSTALL_LIB,libmorestack.a)
99-
$$(Q)$$(call INSTALL_LIB,libcompiler-rt.a)
10099

101100
endef
102101

@@ -111,7 +110,6 @@ install-target-$(1)-host-$(2): $$(CSREQ$$(ISTAGE)_T_$(1)_H_$(2))
111110
$$(Q)$$(foreach crate,$$(TARGET_CRATES),\
112111
$$(call INSTALL_LIB,$$(call CFG_RLIB_GLOB,$$(crate)));)
113112
$$(Q)$$(call INSTALL_LIB,libmorestack.a)
114-
$$(Q)$$(call INSTALL_LIB,libcompiler-rt.a)
115113
endef
116114

117115
$(foreach target,$(CFG_TARGET), \

branches/try2/mk/rt.mk

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -217,37 +217,6 @@ $$(LIBUV_DIR_$(1))/Release/libuv.a: $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) \
217217

218218
endif
219219

220-
################################################################################
221-
# compiler-rt
222-
################################################################################
223-
224-
ifdef CFG_ENABLE_FAST_MAKE
225-
COMPRT_DEPS := $(S)/.gitmodules
226-
else
227-
COMPRT_DEPS := $(wildcard \
228-
$(S)src/compiler-rt/* \
229-
$(S)src/compiler-rt/*/* \
230-
$(S)src/compiler-rt/*/*/* \
231-
$(S)src/compiler-rt/*/*/*/*)
232-
endif
233-
234-
COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
235-
COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
236-
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
237-
238-
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS)
239-
@$$(call E, make: compiler-rt)
240-
$$(Q)$$(MAKE) -C "$(S)src/compiler-rt" \
241-
ProjSrcRoot="$(S)src/compiler-rt" \
242-
ProjObjRoot="$$(abspath $$(COMPRT_BUILD_DIR_$(1)))" \
243-
CC="$$(CC_$(1))" \
244-
AR="$$(AR_$(1))" \
245-
RANLIB="$$(AR_$(1)) s" \
246-
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1))" \
247-
TargetTriple=$(1) \
248-
triple-runtime
249-
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/runtime/libcompiler_rt.a $$(COMPRT_LIB_$(1))
250-
251220
endef
252221

253222
# Instantiate template for all stages/targets

branches/try2/mk/target.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,6 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/:
138138
$$(TLIB$(1)_T_$(2)_H_$(3))/:
139139
mkdir -p $$@
140140

141-
$$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a: \
142-
$$(RT_OUTPUT_DIR_$(2))/$$(call CFG_STATIC_LIB_NAME_$(2),compiler-rt) \
143-
| $$(TLIB$(1)_T_$(2)_H_$(3))/ $$(SNAPSHOT_RUSTC_POST_CLEANUP)
144-
@$$(call E, cp: $$@)
145-
$$(Q)cp $$< $$@
146-
147141
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
148142
$$(RT_OUTPUT_DIR_$(2))/$$(call CFG_STATIC_LIB_NAME_$(2),morestack) \
149143
| $$(TLIB$(1)_T_$(2)_H_$(3))/ $$(SNAPSHOT_RUSTC_POST_CLEANUP)

branches/try2/mk/tests.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ tidy:
262262
| grep '^$(S)src/gyp' -v \
263263
| grep '^$(S)src/etc' -v \
264264
| grep '^$(S)src/doc' -v \
265-
| grep '^$(S)src/compiler-rt' -v \
266265
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
267266

268267
endif

branches/try2/src/compiler-rt

Lines changed: 0 additions & 1 deletion
This file was deleted.

branches/try2/src/compiletest/header.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
108108
else if parse_name_directive(ln, ignore_stage(config)) { false }
109109
else if config.mode == common::mode_pretty &&
110110
parse_name_directive(ln, "ignore-pretty") { false }
111-
else if config.target != config.host &&
112-
parse_name_directive(ln, "ignore-cross-compile") { false }
113111
else { true }
114112
});
115113

branches/try2/src/doc/complement-cheatsheet.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,12 @@ let y: ~str = x.to_str_radix(16);
3636
Use [`FromStrRadix`](http://static.rust-lang.org/doc/master/std/num/trait.FromStrRadix.html), and its helper function, [`from_str_radix`](http://static.rust-lang.org/doc/master/std/num/fn.from_str_radix.html).
3737

3838
~~~
39-
use std::num;
39+
use std::num::from_str_radix;
4040
41-
let x: Option<i64> = num::from_str_radix("deadbeef", 16);
41+
let x: Option<i64> = from_str_radix("deadbeef", 16);
4242
let y: i64 = x.unwrap();
4343
~~~
4444

45-
**Vector of Bytes to String**
46-
47-
To return a Borrowed String Slice (&str) use the str helper function [`from_utf8`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8.html).
48-
49-
~~~
50-
use std::str;
51-
52-
let bytes = ~[104u8,105u8];
53-
let x: Option<&str> = str::from_utf8(bytes);
54-
let y: &str = x.unwrap();
55-
~~~
56-
57-
To return an Owned String (~str) use the str helper function [`from_utf8_owned`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8_owned.html).
58-
59-
~~~
60-
use std::str;
61-
62-
let x: Option<~str> = str::from_utf8_owned(~[104u8,105u8]);
63-
let y: ~str = x.unwrap();
64-
~~~~
65-
66-
To return a [`MaybeOwned`](http://static.rust-lang.org/doc/master/std/str/enum.MaybeOwned.html) use the str helper function [`from_utf8_lossy`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8_owned.html). This function also replaces non-valid utf-8 sequences with U+FFFD replacement character.
67-
68-
~~~
69-
use std::str;
70-
71-
let x = bytes!(72u8,"ello ",0xF0,0x90,0x80,"World!");
72-
let y = str::from_utf8_lossy(x);
73-
~~~~
74-
7545
# File operations
7646

7747
## How do I read from a file?

branches/try2/src/doc/guide-container.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -181,25 +181,19 @@ never call its underlying iterator again once `None` has been returned:
181181
~~~
182182
let xs = [1,2,3,4,5];
183183
let mut calls = 0;
184-
185-
{
186-
let it = xs.iter().scan((), |_, x| {
187-
calls += 1;
188-
if *x < 3 { Some(x) } else { None }});
189-
190-
// the iterator will only yield 1 and 2 before returning None
191-
// If we were to call it 5 times, calls would end up as 5, despite
192-
// only 2 values being yielded (and therefore 3 unique calls being
193-
// made). The fuse() adaptor can fix this.
194-
195-
let mut it = it.fuse();
196-
it.next();
197-
it.next();
198-
it.next();
199-
it.next();
200-
it.next();
201-
}
202-
184+
let it = xs.iter().scan((), |_, x| {
185+
calls += 1;
186+
if *x < 3 { Some(x) } else { None }});
187+
// the iterator will only yield 1 and 2 before returning None
188+
// If we were to call it 5 times, calls would end up as 5, despite only 2 values
189+
// being yielded (and therefore 3 unique calls being made). The fuse() adaptor
190+
// can fix this.
191+
let mut it = it.fuse();
192+
it.next();
193+
it.next();
194+
it.next();
195+
it.next();
196+
it.next();
203197
assert_eq!(calls, 3);
204198
~~~
205199

branches/try2/src/doc/guide-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Instead we can use a `SharedChan`, a type that allows a single
232232
~~~
233233
# use std::task::spawn;
234234
235-
let (port, chan) = Chan::new();
235+
let (port, chan) = SharedChan::new();
236236
237237
for init_val in range(0u, 3) {
238238
// Create a new channel handle to distribute to the child task

branches/try2/src/doc/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ li {list-style-type: none; }
1818
* [Tasks and Communication](guide-tasks.html)
1919
* [Foreign Function Interface](guide-ffi.html)
2020
* [Macros](guide-macros.html)
21+
* [Packaging](guide-rustpkg.html)
2122
* [Testing](guide-testing.html)
2223
* [Conditions](guide-conditions.html)
2324
* [Rust's Runtime](guide-runtime.html)
@@ -31,6 +32,7 @@ li {list-style-type: none; }
3132
* [The 1:1 runtime library, `libnative`](native/index.html)
3233

3334
* [The Rust libuv library, `librustuv`](rustuv/index.html)
35+
* [The Rust packaging library, `librustpkg`](rustpkg/index.html)
3436

3537
* [The Rust parser, `libsyntax`](syntax/index.html)
3638
* [The Rust compiler, `librustc`](rustc/index.html)

branches/try2/src/doc/tutorial.md

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,24 +2679,25 @@ manual.
26792679

26802680
## Files and modules
26812681

2682-
One important aspect of Rust's module system is that source files and modules are not the same thing. You define a module hierarchy, populate it with all your definitions, define visibility, maybe put in a `fn main()`, and that's it.
2682+
One important aspect about Rusts module system is that source files are not important:
2683+
You define a module hierarchy, populate it with all your definitions, define visibility,
2684+
maybe put in a `fn main()`, and that's it: No need to think about source files.
26832685

2684-
The only file that's relevant when compiling is the one that contains the body
2685-
of your crate root, and it's only relevant because you have to pass that file
2686-
to `rustc` to compile your crate.
2686+
The only file that's relevant is the one that contains the body of your crate root,
2687+
and it's only relevant because you have to pass that file to `rustc` to compile your crate.
26872688

2688-
In principle, that's all you need: You can write any Rust program as one giant source file that contains your
2689-
crate root and everything else in `mod ... { ... }` declarations.
2689+
And in principle, that's all you need: You can write any Rust program as one giant source file that contains your
2690+
crate root and everything below it in `mod ... { ... }` declarations.
26902691

2691-
However, in practice you usually want to split up your code into multiple
2692-
source files to make it more manageable. Rust allows you to move the body of
2693-
any module into its own source file. If you declare a module without its body,
2694-
like `mod foo;`, the compiler will look for the files `foo.rs` and `foo/mod.rs`
2695-
inside some directory (usually the same as of the source file containing the
2696-
`mod foo;` declaration). If it finds either, it uses the content of that file
2697-
as the body of the module. If it finds both, that's a compile error.
2692+
However, in practice you usually want to split you code up into multiple source files to make it more manageable.
2693+
In order to do that, Rust allows you to move the body of any module into it's own source file, which works like this:
26982694

2699-
To move the content of `mod farm` into its own file, you can write:
2695+
If you declare a module without its body, like `mod foo;`, the compiler will look for the
2696+
files `foo.rs` and `foo/mod.rs` inside some directory (usually the same as of the source file containing
2697+
the `mod foo;`). If it finds either, it uses the content of that file as the body of the module.
2698+
If it finds both, that's a compile error.
2699+
2700+
So, if we want to move the content of `mod farm` into it's own file, it would look like this:
27002701

27012702
~~~~ {.ignore}
27022703
// `main.rs` - contains body of the crate root
@@ -2721,13 +2722,17 @@ pub mod barn {
27212722

27222723
In short, `mod foo;` is just syntactic sugar for `mod foo { /* content of <...>/foo.rs or <...>/foo/mod.rs */ }`.
27232724

2724-
This also means that having two or more identical `mod foo;` declarations somewhere in your crate hierarchy is generally a bad idea,
2725-
just like copy-and-paste-ing a module into multiple places is a bad idea.
2725+
This also means that having two or more identical `mod foo;` somewhere
2726+
in your crate hierarchy is generally a bad idea,
2727+
just like copy-and-paste-ing a module into two or more places is one.
27262728
Both will result in duplicate and mutually incompatible definitions.
27272729

2728-
When `rustc` resolves these module declarations, it starts by looking in the
2729-
parent directory of the file containing the `mod foo` declaration. For example,
2730-
given a file with the module body:
2730+
The directory the compiler looks in for those two files is determined by starting with
2731+
the same directory as the source file that contains the `mod foo;` declaration, and concatenating to that a
2732+
path equivalent to the relative path of all nested `mod { ... }` declarations the `mod foo;`
2733+
is contained in, if any.
2734+
2735+
For example, given a file with this module body:
27312736

27322737
~~~ {.ignore}
27332738
// `src/main.rs`
@@ -2740,7 +2745,7 @@ mod animals {
27402745
}
27412746
~~~
27422747

2743-
The compiler will look for these files, in this order:
2748+
The compiler would then try all these files:
27442749

27452750
~~~ {.notrust}
27462751
src/plants.rs
@@ -2753,9 +2758,9 @@ src/animals/mammals/humans.rs
27532758
src/animals/mammals/humans/mod.rs
27542759
~~~
27552760

2756-
Keep in mind that identical module hierarchies can still lead to different path
2757-
lookups depending on how and where you've moved a module body to its own file.
2758-
For example, if you move the `animals` module into its own file:
2761+
Keep in mind that identical module hierachies can still lead to different path lookups
2762+
depending on how and where you've moved a module body to its own file.
2763+
For example, if we move the `animals` module above into its own file...
27592764

27602765
~~~ {.ignore}
27612766
// `src/main.rs`
@@ -2771,21 +2776,21 @@ mod mammals {
27712776
}
27722777
~~~
27732778

2774-
...then the source files of `mod animals`'s submodules can either be in the same directory as the animals source file or in a subdirectory of its directory. If the animals file is `src/animals.rs`, `rustc` will look for:
2779+
...then the source files of `mod animals`'s submodules can
2780+
either be placed right next to that of its parents, or in a subdirectory if `animals` source file is:
27752781

27762782
~~~ {.notrust}
2777-
src/animals.rs
2783+
src/plants.rs
2784+
src/plants/mod.rs
2785+
2786+
src/animals.rs - if file sits next to that of parent module's:
27782787
src/fish.rs
27792788
src/fish/mod.rs
27802789
27812790
src/mammals/humans.rs
27822791
src/mammals/humans/mod.rs
2783-
~~
2784-
2785-
If the animals file is `src/animals/mod.rs`, `rustc` will look for:
27862792
2787-
~~ {.notrust}
2788-
src/animals/mod.rs
2793+
src/animals/mod.rs - if file is in it's own subdirectory:
27892794
src/animals/fish.rs
27902795
src/animals/fish/mod.rs
27912796
@@ -2794,11 +2799,11 @@ src/animals/mod.rs
27942799
27952800
~~~
27962801

2797-
These rules allow you to write small modules consisting of single source files which can live in the same directory as well as large modules which group submodule source files in subdirectories.
2802+
These rules allow you to have both small modules that only need
2803+
to consist of one source file each and can be conveniently placed right next to each other,
2804+
and big complicated modules that group the source files of submodules in subdirectories.
27982805

2799-
If you need to override where `rustc` will look for the file containing a
2800-
module's source code, use the `path` compiler directive. For example, to load a
2801-
`classified` module from a different file:
2806+
If you need to circumvent the defaults, you can also overwrite the path a `mod foo;` would take:
28022807

28032808
~~~ {.ignore}
28042809
#[path="../../area51/alien.rs"]

0 commit comments

Comments
 (0)