Skip to content

Commit 65354ab

Browse files
committed
---
yaml --- r: 151160 b: refs/heads/try2 c: dee21a6 h: refs/heads/master v: v3
1 parent 5324772 commit 65354ab

File tree

52 files changed

+299
-677
lines changed

Some content is hidden

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

52 files changed

+299
-677
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: 7a19a82d119ca51ed872ed207bed396cdf4a3283
8+
refs/heads/try2: dee21a67b802ba9d8a0fac11369cbcd53552a216
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/complement-lang-faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Some examples that demonstrate different aspects of the language:
2222

2323
[sprocketnes]: https://github.com/pcwalton/sprocketnes
2424
[hash]: https://github.com/mozilla/rust/blob/master/src/libstd/hash.rs
25-
[HashMap]: https://github.com/mozilla/rust/blob/master/src/libcollections/hashmap.rs
26-
[json]: https://github.com/mozilla/rust/blob/master/src/libserialize/json.rs
25+
[HashMap]: https://github.com/mozilla/rust/blob/master/src/libstd/hashmap.rs
26+
[json]: https://github.com/mozilla/rust/blob/master/src/libextra/json.rs
2727

2828
You may also be interested in browsing [GitHub's Rust][github-rust] page.
2929

branches/try2/src/doc/tutorial.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,11 @@ spawn(proc() {
17931793
});
17941794
~~~~
17951795
1796+
> *Note:* If you want to see the output of `debug!` statements, you will need to turn on
1797+
> `debug!` logging. To enable `debug!` logging, set the RUST_LOG environment
1798+
> variable to the name of your crate, which, for a file named `foo.rs`, will be
1799+
> `foo` (e.g., with bash, `export RUST_LOG=foo`).
1800+
17961801
## Closure compatibility
17971802
17981803
Rust closures have a convenient subtyping property: you can pass any kind of

branches/try2/src/etc/maketest.py

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,26 @@
1212
import os
1313
import sys
1414

15-
# msys1/msys2 automatically converts `/abs/path1:/abs/path2` into
16-
# `c:\real\abs\path1;c:\real\abs\path2` (semicolons) if shell thinks
17-
# the value is list of paths.
18-
# this causes great confusion and error: shell and Makefile doesn't like
19-
# windows paths so it is really error-prone. revert it for peace.
20-
def normalize_path(v):
21-
# c:\path -> /c/path
22-
if ':\\' in v:
23-
v = '/' + v.replace(':\\', '/')
24-
v = v.replace('\\', '/')
25-
return v
26-
27-
28-
def putenv(name, value):
29-
if os.name == 'nt':
30-
value = normalize_path(value)
31-
os.putenv(name, value)
32-
15+
# FIXME #12303 these tests are broken on windows
16+
if os.name == 'nt':
17+
print 'ignoring make tests on windows'
18+
sys.exit(0)
3319

3420
make = sys.argv[2]
35-
putenv('RUSTC', os.path.abspath(sys.argv[3]))
36-
putenv('TMPDIR', os.path.abspath(sys.argv[4]))
37-
putenv('CC', sys.argv[5])
38-
putenv('RUSTDOC', os.path.abspath(sys.argv[6]))
21+
os.putenv('RUSTC', os.path.abspath(sys.argv[3]))
22+
os.putenv('TMPDIR', os.path.abspath(sys.argv[4]))
23+
os.putenv('CC', sys.argv[5])
24+
os.putenv('RUSTDOC', os.path.abspath(sys.argv[6]))
3925
filt = sys.argv[7]
4026
ldpath = sys.argv[8]
4127
if ldpath != '':
42-
name = ldpath.split('=')[0]
43-
value = ldpath.split('=')[1]
44-
if os.name == 'nt' and name != 'PATH':
45-
value = ":".join(normalize_path(v) for v in value.split(";"))
46-
os.putenv(name, value)
28+
os.putenv(ldpath.split('=')[0], ldpath.split('=')[1])
4729

4830
if not filt in sys.argv[1]:
4931
sys.exit(0)
5032
print('maketest: ' + os.path.basename(os.path.dirname(sys.argv[1])))
5133

52-
path = sys.argv[1]
53-
if path[-1] == '/':
54-
# msys1 has a bug that `make` fails to include `../tools.mk` (parent dir)
55-
# if `-C path` option is given and `path` is absolute directory with
56-
# trailing slash (`c:/path/to/test/`).
57-
# the easist workaround is to remove the slash (`c:/path/to/test`).
58-
# msys2 seems to fix this problem.
59-
path = path[:-1]
60-
61-
proc = subprocess.Popen([make, '-C', path],
34+
proc = subprocess.Popen([make, '-C', sys.argv[1]],
6235
stdout = subprocess.PIPE,
6336
stderr = subprocess.PIPE)
6437
out, err = proc.communicate()

branches/try2/src/libnum/bigint.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ impl Sub<BigUint, BigUint> for BigUint {
230230
lo
231231
}).collect();
232232

233-
assert!(borrow == 0,
234-
"Cannot subtract other from self because other is larger than self.");
233+
assert_eq!(borrow, 0); // <=> assert!((self >= other));
235234
return BigUint::new(diff);
236235
}
237236
}
@@ -1756,13 +1755,6 @@ mod biguint_tests {
17561755
}
17571756
}
17581757

1759-
#[test]
1760-
#[should_fail]
1761-
fn test_sub_fail_on_underflow() {
1762-
let (a, b) : (BigUint, BigUint) = (Zero::zero(), One::one());
1763-
a - b;
1764-
}
1765-
17661758
static mul_triples: &'static [(&'static [BigDigit],
17671759
&'static [BigDigit],
17681760
&'static [BigDigit])] = &[

branches/try2/src/librustc/front/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ fn fold_mod(cx: &mut Context, m: &ast::Mod) -> ast::Mod {
7070
filter_view_item(cx, a).map(|x| cx.fold_view_item(x))
7171
}).collect();
7272
ast::Mod {
73+
inner: m.inner,
7374
view_items: filtered_view_items,
7475
items: flattened_items
7576
}

branches/try2/src/librustc/front/feature_gate.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ impl<'a> Visitor<()> for Context<'a> {
130130

131131
fn visit_view_item(&mut self, i: &ast::ViewItem, _: ()) {
132132
match i.node {
133-
ast::ViewItemUse(ref path) => {
134-
match path.node {
135-
ast::ViewPathGlob(..) => {
136-
self.gate_feature("globs", path.span,
137-
"glob import statements are \
138-
experimental and possibly buggy");
133+
ast::ViewItemUse(ref paths) => {
134+
for path in paths.iter() {
135+
match path.node {
136+
ast::ViewPathGlob(..) => {
137+
self.gate_feature("globs", path.span,
138+
"glob import statements are \
139+
experimental and possibly buggy");
140+
}
141+
_ => {}
139142
}
140-
_ => {}
141143
}
142144
}
143145
ast::ViewItemExternCrate(..) => {

branches/try2/src/librustc/front/std_inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<'a> fold::Folder for PreludeInjector<'a> {
166166

167167
let vp = @codemap::dummy_spanned(ast::ViewPathGlob(prelude_path, ast::DUMMY_NODE_ID));
168168
let vi2 = ast::ViewItem {
169-
node: ast::ViewItemUse(vp),
169+
node: ast::ViewItemUse(vec!(vp)),
170170
attrs: Vec::new(),
171171
vis: ast::Inherited,
172172
span: DUMMY_SP,

branches/try2/src/librustc/front/test.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> {
143143
}
144144

145145
let mod_nomain = ast::Mod {
146+
inner: m.inner,
146147
view_items: m.view_items.clone(),
147148
items: m.items.iter().map(|i| nomain(&self.cx, *i)).collect(),
148149
};
@@ -299,9 +300,9 @@ fn mk_std(cx: &TestCtxt) -> ast::ViewItem {
299300
let id_test = token::str_to_ident("test");
300301
let (vi, vis) = if cx.is_test_crate {
301302
(ast::ViewItemUse(
302-
@nospan(ast::ViewPathSimple(id_test,
303-
path_node(vec!(id_test)),
304-
ast::DUMMY_NODE_ID))),
303+
vec!(@nospan(ast::ViewPathSimple(id_test,
304+
path_node(vec!(id_test)),
305+
ast::DUMMY_NODE_ID)))),
305306
ast::Public)
306307
} else {
307308
(ast::ViewItemExternCrate(id_test,
@@ -335,6 +336,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::Item {
335336
)).unwrap();
336337

337338
let testmod = ast::Mod {
339+
inner: DUMMY_SP,
338340
view_items: view_items,
339341
items: vec!(mainfn, tests),
340342
};

branches/try2/src/librustc/middle/privacy.rs

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -872,24 +872,26 @@ impl<'a> Visitor<()> for PrivacyVisitor<'a> {
872872
fn visit_view_item(&mut self, a: &ast::ViewItem, _: ()) {
873873
match a.node {
874874
ast::ViewItemExternCrate(..) => {}
875-
ast::ViewItemUse(ref vpath) => {
876-
match vpath.node {
877-
ast::ViewPathSimple(..) | ast::ViewPathGlob(..) => {}
878-
ast::ViewPathList(_, ref list, _) => {
879-
for pid in list.iter() {
880-
debug!("privacy - list {}", pid.node.id);
881-
let seg = ast::PathSegment {
882-
identifier: pid.node.name,
883-
lifetimes: Vec::new(),
884-
types: OwnedSlice::empty(),
885-
};
886-
let segs = vec!(seg);
887-
let path = ast::Path {
888-
global: false,
889-
span: pid.span,
890-
segments: segs,
891-
};
892-
self.check_path(pid.span, pid.node.id, &path);
875+
ast::ViewItemUse(ref uses) => {
876+
for vpath in uses.iter() {
877+
match vpath.node {
878+
ast::ViewPathSimple(..) | ast::ViewPathGlob(..) => {}
879+
ast::ViewPathList(_, ref list, _) => {
880+
for pid in list.iter() {
881+
debug!("privacy - list {}", pid.node.id);
882+
let seg = ast::PathSegment {
883+
identifier: pid.node.name,
884+
lifetimes: Vec::new(),
885+
types: OwnedSlice::empty(),
886+
};
887+
let segs = vec!(seg);
888+
let path = ast::Path {
889+
global: false,
890+
span: pid.span,
891+
segments: segs,
892+
};
893+
self.check_path(pid.span, pid.node.id, &path);
894+
}
893895
}
894896
}
895897
}

0 commit comments

Comments
 (0)