Skip to content

Commit 48301eb

Browse files
committed
---
yaml --- r: 143853 b: refs/heads/try2 c: 20953bb h: refs/heads/master i: 143851: 7dcbe55 v: v3
1 parent febeea9 commit 48301eb

File tree

233 files changed

+3706
-8672
lines changed

Some content is hidden

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

233 files changed

+3706
-8672
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: 437a4c28a338767bab9d003a80bcea38c658791b
8+
refs/heads/try2: 20953bb1fbfafc3839e739f38ddf7d495eb1fe8b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rust.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ There are several kinds of view item:
744744
##### Extern mod declarations
745745

746746
~~~~~~~~ {.ebnf .gram}
747-
extern_mod_decl : "extern" "mod" ident [ '(' link_attrs ')' ] ? ;
747+
extern_mod_decl : "extern" "mod" ident [ '(' link_attrs ')' ] ? [ '=' string_lit ] ? ;
748748
link_attrs : link_attr [ ',' link_attrs ] + ;
749749
link_attr : ident '=' literal ;
750750
~~~~~~~~
@@ -755,20 +755,34 @@ as the `ident` provided in the `extern_mod_decl`.
755755

756756
The external crate is resolved to a specific `soname` at compile time,
757757
and a runtime linkage requirement to that `soname` is passed to the linker for
758-
loading at runtime. The `soname` is resolved at compile time by scanning the
759-
compiler's library path and matching the `link_attrs` provided in the
760-
`use_decl` against any `#link` attributes that were declared on the external
761-
crate when it was compiled. If no `link_attrs` are provided, a default `name`
762-
attribute is assumed, equal to the `ident` given in the `use_decl`.
763-
764-
Three examples of `extern mod` declarations:
758+
loading at runtime.
759+
The `soname` is resolved at compile time by scanning the compiler's library path
760+
and matching the `link_attrs` provided in the `use_decl` against any `#link` attributes that
761+
were declared on the external crate when it was compiled.
762+
If no `link_attrs` are provided,
763+
a default `name` attribute is assumed,
764+
equal to the `ident` given in the `use_decl`.
765+
766+
Optionally, an identifier in an `extern mod` declaration may be followed by an equals sign,
767+
then a string literal denoting a relative path on the filesystem.
768+
This path should exist in one of the directories in the Rust path,
769+
which by default contains the `.rust` subdirectory of the current directory and each of its parents,
770+
as well as any directories in the colon-separated (or semicolon-separated on Windows)
771+
list of paths that is the `RUST_PATH` environment variable.
772+
The meaning of `extern mod a = "b/c/d";`, supposing that `/a` is in the RUST_PATH,
773+
is that the name `a` should be taken as a reference to the crate whose absolute location is
774+
`/a/b/c/d`.
775+
776+
Four examples of `extern mod` declarations:
765777

766778
~~~~~~~~{.xfail-test}
767779
extern mod pcre (uuid = "54aba0f8-a7b1-4beb-92f1-4cf625264841");
768780
769781
extern mod extra; // equivalent to: extern mod extra ( name = "extra" );
770782
771783
extern mod rustextra (name = "extra"); // linking to 'extra' under another name
784+
785+
extern mod complicated_mod = "some-file/in/the-rust/path";
772786
~~~~~~~~
773787

774788
##### Use declarations

branches/try2/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ match crayons[0] {
13051305
A vector can be destructured using pattern matching:
13061306
13071307
~~~~
1308-
let numbers: [int, ..3] = [1, 2, 3];
1308+
let numbers: &[int] = &[1, 2, 3];
13091309
let score = match numbers {
13101310
[] => 0,
13111311
[a] => a * 10,
@@ -2195,7 +2195,7 @@ use std::float::consts::pi;
21952195
# impl Shape for CircleStruct { fn area(&self) -> float { pi * square(self.radius) } }
21962196
21972197
let concrete = @CircleStruct{center:Point{x:3f,y:4f},radius:5f};
2198-
let mycircle: Circle = concrete as @Circle;
2198+
let mycircle: @Circle = concrete as @Circle;
21992199
let nonsense = mycircle.radius() * mycircle.area();
22002200
~~~
22012201

branches/try2/mk/install.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ endef
199199
$(foreach target,$(CFG_TARGET_TRIPLES), \
200200
$(if $(findstring $(target),"arm-linux-androideabi"), \
201201
$(if $(findstring adb,$(CFG_ADB)), \
202-
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[_A-Za-z0-9-]+[[:blank:]]+device')), \
202+
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[_A-Za-z0-9-]+[[:blank:]]+device')), \
203203
$(info install: install-runtime-target for $(target) enabled \
204204
$(info install: android device attached) \
205205
$(eval $(call DEF_ADB_DEVICE_STATUS, true))), \

branches/try2/mk/rt.mk

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,21 @@ RUNTIME_CXXS_$(1)_$(2) := \
6666
rt/sync/timer.cpp \
6767
rt/sync/lock_and_signal.cpp \
6868
rt/sync/rust_thread.cpp \
69-
rt/rust.cpp \
7069
rt/rust_builtin.cpp \
7170
rt/rust_run_program.cpp \
7271
rt/rust_env.cpp \
7372
rt/rust_rng.cpp \
74-
rt/rust_sched_loop.cpp \
75-
rt/rust_sched_launcher.cpp \
76-
rt/rust_sched_driver.cpp \
77-
rt/rust_scheduler.cpp \
78-
rt/rust_sched_reaper.cpp \
79-
rt/rust_task.cpp \
8073
rt/rust_stack.cpp \
8174
rt/rust_upcall.cpp \
8275
rt/rust_uv.cpp \
8376
rt/rust_crate_map.cpp \
84-
rt/rust_log.cpp \
8577
rt/rust_gc_metadata.cpp \
8678
rt/rust_util.cpp \
79+
rt/rust_log.cpp \
8780
rt/rust_exchange_alloc.cpp \
8881
rt/isaac/randport.cpp \
8982
rt/miniz.cpp \
90-
rt/rust_kernel.cpp \
9183
rt/rust_abi.cpp \
92-
rt/rust_debug.cpp \
9384
rt/memory_region.cpp \
9485
rt/boxed_region.cpp \
9586
rt/arch/$$(HOST_$(1))/context.cpp \

branches/try2/mk/tests.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ endef
123123
$(foreach target,$(CFG_TARGET_TRIPLES), \
124124
$(if $(findstring $(target),"arm-linux-androideabi"), \
125125
$(if $(findstring adb,$(CFG_ADB)), \
126-
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[_A-Za-z0-9-]+[[:blank:]]+device')), \
126+
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[_A-Za-z0-9-]+[[:blank:]]+device')), \
127127
$(info check: $(target) test enabled \
128128
$(info check: android device attached) \
129129
$(eval $(call DEF_ADB_DEVICE_STATUS, true))), \
@@ -348,7 +348,9 @@ $(3)/stage$(1)/test/rustpkgtest-$(2)$$(X_$(2)): \
348348
$$(RUSTPKG_LIB) $$(RUSTPKG_INPUTS) \
349349
$$(SREQ$(1)_T_$(2)_H_$(3)) \
350350
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX_$(2)) \
351-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2))
351+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2)) \
352+
$$(TBIN$(1)_T_$(2)_H_$(3))/rustpkg$$(X_$(2)) \
353+
$$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X_$(2))
352354
@$$(call E, compile_and_link: $$@)
353355
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
354356

branches/try2/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn parse_check_line(line: &str) -> Option<~str> {
142142
fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
143143
do parse_name_value_directive(line, ~"exec-env").map |nv| {
144144
// nv is either FOO or FOO=BAR
145-
let mut strs: ~[~str] = nv.splitn_iter('=', 1).transform(|s| s.to_owned()).collect();
145+
let mut strs: ~[~str] = nv.splitn_iter('=', 1).map(|s| s.to_owned()).collect();
146146

147147
match strs.len() {
148148
1u => (strs.pop(), ~""),

branches/try2/src/compiletest/runtest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,13 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
350350
fatal(~"process did not return an error status");
351351
}
352352

353-
let prefixes = expected_errors.iter().transform(|ee| {
353+
let prefixes = expected_errors.iter().map(|ee| {
354354
fmt!("%s:%u:", testfile.to_str(), ee.line)
355355
}).collect::<~[~str]>();
356356

357357
fn to_lower( s : &str ) -> ~str {
358358
let i = s.iter();
359-
let c : ~[char] = i.transform( |c| {
359+
let c : ~[char] = i.map( |c| {
360360
if c.is_ascii() {
361361
c.to_ascii().to_lower().to_char()
362362
} else {
@@ -760,7 +760,7 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
760760
let cmdline = make_cmdline("", args.prog, args.args);
761761

762762
// get bare program string
763-
let mut tvec: ~[~str] = args.prog.split_iter('/').transform(|ts| ts.to_owned()).collect();
763+
let mut tvec: ~[~str] = args.prog.split_iter('/').map(|ts| ts.to_owned()).collect();
764764
let prog_short = tvec.pop();
765765

766766
// copy to target
@@ -938,7 +938,7 @@ fn disassemble_extract(config: &config, _props: &TestProps,
938938

939939
fn count_extracted_lines(p: &Path) -> uint {
940940
let x = io::read_whole_file_str(&p.with_filetype("ll")).unwrap();
941-
x.line_iter().len_()
941+
x.line_iter().len()
942942
}
943943

944944

branches/try2/src/etc/emacs/rust-mode.el

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929

3030
table))
3131

32+
(defcustom rust-indent-offset default-tab-width
33+
"*Indent Rust code by this number of spaces.
34+
35+
The initializer is `DEFAULT-TAB-WIDTH'.")
36+
3237
(defun rust-paren-level () (nth 0 (syntax-ppss)))
3338
(defun rust-in-str-or-cmnt () (nth 8 (syntax-ppss)))
3439
(defun rust-rewind-past-str-cmnt () (goto-char (nth 8 (syntax-ppss))))
@@ -49,10 +54,10 @@
4954
(let ((level (rust-paren-level)))
5055
(cond
5156
;; A function return type is 1 level indented
52-
((looking-at "->") (* default-tab-width (+ level 1)))
57+
((looking-at "->") (* rust-indent-offset (+ level 1)))
5358

5459
;; A closing brace is 1 level unindended
55-
((looking-at "}") (* default-tab-width (- level 1)))
60+
((looking-at "}") (* rust-indent-offset (- level 1)))
5661

5762
;; If we're in any other token-tree / sexp, then:
5863
;; - [ or ( means line up with the opening token
@@ -70,18 +75,18 @@
7075
(goto-char pt)
7176
(back-to-indentation)
7277
(if (looking-at "\\<else\\>")
73-
(* default-tab-width (+ 1 level))
78+
(* rust-indent-offset (+ 1 level))
7479
(progn
7580
(goto-char pt)
7681
(beginning-of-line)
7782
(rust-rewind-irrelevant)
7883
(end-of-line)
7984
(if (looking-back "[{};,]")
80-
(* default-tab-width level)
85+
(* rust-indent-offset level)
8186
(back-to-indentation)
8287
(if (looking-at "#")
83-
(* default-tab-width level)
84-
(* default-tab-width (+ 1 level))))))))))
88+
(* rust-indent-offset level)
89+
(* rust-indent-offset (+ 1 level))))))))))
8590

8691
;; Otherwise we're in a column-zero definition
8792
(t 0))))))

branches/try2/src/libextra/arc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,14 @@ mod tests {
596596
let (c,p) = (Cell::new(c), Cell::new(p));
597597
do task::spawn || {
598598
// wait until parent gets in
599-
comm::recv_one(p.take());
599+
p.take().recv();
600600
do arc2.access_cond |state, cond| {
601601
*state = true;
602602
cond.signal();
603603
}
604604
}
605605
do arc.access_cond |state, cond| {
606-
comm::send_one(c.take(), ());
606+
c.take().send(());
607607
assert!(!*state);
608608
while !*state {
609609
cond.wait();

branches/try2/src/libextra/bitv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ impl BitvSet {
869869
let min = num::min(self.bitv.storage.len(), other.bitv.storage.len());
870870
self.bitv.storage.slice(0, min).iter().enumerate()
871871
.zip(Repeat::new(&other.bitv.storage))
872-
.transform(|((i, &w), o_store)| (i * uint::bits, w, o_store[i]))
872+
.map(|((i, &w), o_store)| (i * uint::bits, w, o_store[i]))
873873
}
874874

875875
/// Visits each word in self or other that extends beyond the other. This
@@ -888,11 +888,11 @@ impl BitvSet {
888888
if olen < slen {
889889
self.bitv.storage.slice_from(olen).iter().enumerate()
890890
.zip(Repeat::new(olen))
891-
.transform(|((i, &w), min)| (true, (i + min) * uint::bits, w))
891+
.map(|((i, &w), min)| (true, (i + min) * uint::bits, w))
892892
} else {
893893
other.bitv.storage.slice_from(slen).iter().enumerate()
894894
.zip(Repeat::new(slen))
895-
.transform(|((i, &w), min)| (false, (i + min) * uint::bits, w))
895+
.map(|((i, &w), min)| (false, (i + min) * uint::bits, w))
896896
}
897897
}
898898
}

0 commit comments

Comments
 (0)