Skip to content

Commit 43254e8

Browse files
committed
---
yaml --- r: 151187 b: refs/heads/try2 c: 5371146 h: refs/heads/master i: 151185: 3c88628 151183: 13d5b80 v: v3
1 parent 8e8e778 commit 43254e8

File tree

108 files changed

+918
-1292
lines changed

Some content is hidden

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

108 files changed

+918
-1292
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: 33259d979742e643a5dda4889d17d59c6fcf63e4
8+
refs/heads/try2: 53711461070ec8ad0d71c4bcdb35de3120e07ec5
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/tests.mk

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,6 @@ TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
349349
$$(foreach crate,$$(TARGET_CRATES),\
350350
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
351351
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
352-
353-
# The regex crate depends on the regex_macros crate during testing, but it
354-
# notably depend on the *host* regex_macros crate, not the target version.
355-
# Additionally, this is not a dependency in stage1, only in stage2.
356-
ifeq ($(4),regex)
357-
ifneq ($(1),1)
358-
TESTDEP_$(1)_$(2)_$(3)_$(4) += $$(TLIB$(1)_T_$(3)_H_$(3))/stamp.regex_macros
359-
endif
360-
endif
361-
362352
else
363353
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
364354
endif

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/back/link.rs

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,6 @@ pub mod write {
152152
(sess.targ_cfg.os == abi::OsMacos &&
153153
sess.targ_cfg.arch == abi::X86_64);
154154

155-
// OSX has -dead_strip, which doesn't rely on ffunction_sections
156-
// FIXME(#13846) this should be enabled for windows
157-
let ffunction_sections = sess.targ_cfg.os != abi::OsMacos &&
158-
sess.targ_cfg.os != abi::OsWin32;
159-
let fdata_sections = ffunction_sections;
160-
161155
let reloc_model = match sess.opts.cg.relocation_model.as_slice() {
162156
"pic" => lib::llvm::RelocPIC,
163157
"static" => lib::llvm::RelocStatic,
@@ -179,11 +173,9 @@ pub mod write {
179173
lib::llvm::CodeModelDefault,
180174
reloc_model,
181175
opt_level,
182-
true /* EnableSegstk */,
176+
true,
183177
use_softfp,
184-
no_fp_elim,
185-
ffunction_sections,
186-
fdata_sections,
178+
no_fp_elim
187179
)
188180
})
189181
})
@@ -1144,38 +1136,20 @@ fn link_args(sess: &Session,
11441136
args.push("-nodefaultlibs".to_owned());
11451137
}
11461138

1147-
// If we're building a dylib, we don't use --gc-sections because LLVM has
1148-
// already done the best it can do, and we also don't want to eliminate the
1149-
// metadata. If we're building an executable, however, --gc-sections drops
1150-
// the size of hello world from 1.8MB to 597K, a 67% reduction.
1151-
if !dylib && sess.targ_cfg.os != abi::OsMacos {
1152-
args.push("-Wl,--gc-sections".to_owned());
1153-
}
1154-
11551139
if sess.targ_cfg.os == abi::OsLinux {
11561140
// GNU-style linkers will use this to omit linking to libraries which
11571141
// don't actually fulfill any relocations, but only for libraries which
11581142
// follow this flag. Thus, use it before specifying libraries to link to.
11591143
args.push("-Wl,--as-needed".to_owned());
11601144

1161-
// GNU-style linkers support optimization with -O. GNU ld doesn't need a
1162-
// numeric argument, but other linkers do.
1145+
// GNU-style linkers support optimization with -O. --gc-sections
1146+
// removes metadata and potentially other useful things, so don't
1147+
// include it. GNU ld doesn't need a numeric argument, but other linkers
1148+
// do.
11631149
if sess.opts.optimize == session::Default ||
11641150
sess.opts.optimize == session::Aggressive {
11651151
args.push("-Wl,-O1".to_owned());
11661152
}
1167-
} else if sess.targ_cfg.os == abi::OsMacos {
1168-
// The dead_strip option to the linker specifies that functions and data
1169-
// unreachable by the entry point will be removed. This is quite useful
1170-
// with Rust's compilation model of compiling libraries at a time into
1171-
// one object file. For example, this brings hello world from 1.7MB to
1172-
// 458K.
1173-
//
1174-
// Note that this is done for both executables and dynamic libraries. We
1175-
// won't get much benefit from dylibs because LLVM will have already
1176-
// stripped away as much as it could. This has not been seen to impact
1177-
// link times negatively.
1178-
args.push("-Wl,-dead_strip".to_owned());
11791153
}
11801154

11811155
if sess.targ_cfg.os == abi::OsWin32 {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ 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,
7473
view_items: filtered_view_items,
7574
items: flattened_items
7675
}

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

145145
let mod_nomain = ast::Mod {
146-
inner: m.inner,
147146
view_items: m.view_items.clone(),
148147
items: m.items.iter().map(|i| nomain(&self.cx, *i)).collect(),
149148
};
@@ -300,9 +299,9 @@ fn mk_std(cx: &TestCtxt) -> ast::ViewItem {
300299
let id_test = token::str_to_ident("test");
301300
let (vi, vis) = if cx.is_test_crate {
302301
(ast::ViewItemUse(
303-
@nospan(ast::ViewPathSimple(id_test,
304-
path_node(vec!(id_test)),
305-
ast::DUMMY_NODE_ID))),
302+
vec!(@nospan(ast::ViewPathSimple(id_test,
303+
path_node(vec!(id_test)),
304+
ast::DUMMY_NODE_ID)))),
306305
ast::Public)
307306
} else {
308307
(ast::ViewItemExternCrate(id_test,
@@ -336,7 +335,6 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::Item {
336335
)).unwrap();
337336

338337
let testmod = ast::Mod {
339-
inner: DUMMY_SP,
340338
view_items: view_items,
341339
items: vec!(mainfn, tests),
342340
};

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,9 +1748,7 @@ pub mod llvm {
17481748
Level: CodeGenOptLevel,
17491749
EnableSegstk: bool,
17501750
UseSoftFP: bool,
1751-
NoFramePointerElim: bool,
1752-
FunctionSections: bool,
1753-
DataSections: bool) -> TargetMachineRef;
1751+
NoFramePointerElim: bool) -> TargetMachineRef;
17541752
pub fn LLVMRustDisposeTargetMachine(T: TargetMachineRef);
17551753
pub fn LLVMRustAddAnalysisPasses(T: TargetMachineRef,
17561754
PM: PassManagerRef,

branches/try2/src/librustc/metadata/tydecode.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,23 @@ pub fn parse_substs_data(data: &[u8], crate_num: ast::CrateNum, pos: uint, tcx:
138138
parse_substs(&mut st, conv)
139139
}
140140

141+
fn parse_vstore(st: &mut PState, conv: conv_did) -> ty::Vstore {
142+
assert_eq!(next(st), '/');
143+
144+
let c = peek(st);
145+
if '0' <= c && c <= '9' {
146+
let n = parse_uint(st);
147+
assert_eq!(next(st), '|');
148+
return ty::VstoreFixed(n);
149+
}
150+
151+
match next(st) {
152+
'~' => ty::VstoreUniq,
153+
'&' => ty::VstoreSlice(parse_region(st, conv)),
154+
c => st.tcx.sess.bug(format!("parse_vstore(): bad input '{}'", c))
155+
}
156+
}
157+
141158
fn parse_size(st: &mut PState) -> Option<uint> {
142159
assert_eq!(next(st), '/');
143160

@@ -344,7 +361,8 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
344361
return ty::mk_vec(st.tcx, mt, sz);
345362
}
346363
'v' => {
347-
return ty::mk_str(st.tcx);
364+
let v = parse_vstore(st, |x,y| conv(x,y));
365+
return ty::mk_str(st.tcx, v);
348366
}
349367
'T' => {
350368
assert_eq!(next(st), '[');

branches/try2/src/librustc/metadata/tyencode.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,21 @@ fn enc_bound_region(w: &mut MemWriter, cx: &ctxt, br: ty::BoundRegion) {
177177
}
178178
}
179179

180+
pub fn enc_vstore(w: &mut MemWriter, cx: &ctxt,
181+
v: ty::Vstore,
182+
enc_mut: |&mut MemWriter|) {
183+
mywrite!(w, "/");
184+
match v {
185+
ty::VstoreFixed(u) => mywrite!(w, "{}|", u),
186+
ty::VstoreUniq => mywrite!(w, "~"),
187+
ty::VstoreSlice(r) => {
188+
mywrite!(w, "&");
189+
enc_region(w, cx, r);
190+
enc_mut(w);
191+
}
192+
}
193+
}
194+
180195
pub fn enc_trait_ref(w: &mut MemWriter, cx: &ctxt, s: &ty::TraitRef) {
181196
mywrite!(w, "{}|", (cx.ds)(s.def_id));
182197
enc_substs(w, cx, &s.substs);
@@ -260,8 +275,9 @@ fn enc_sty(w: &mut MemWriter, cx: &ctxt, st: &ty::sty) {
260275
None => mywrite!(w, "|"),
261276
}
262277
}
263-
ty::ty_str => {
278+
ty::ty_str(v) => {
264279
mywrite!(w, "v");
280+
enc_vstore(w, cx, v, |_| {});
265281
}
266282
ty::ty_closure(ref f) => {
267283
mywrite!(w, "f");

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ fn missing_ctor(cx: &MatchCheckCtxt,
405405
ty::ty_struct(..) => check_matrix_for_wild(cx, m),
406406
ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty: ty, ..}) => match ty::get(ty).sty {
407407
ty::ty_vec(_, None) => ctor_for_slice(m),
408-
ty::ty_str => Some(single),
409408
_ => check_matrix_for_wild(cx, m),
410409
},
411410
ty::ty_enum(eid, _) => {

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,7 @@ impl<'a> EffectCheckVisitor<'a> {
6868
debug!("effect: checking index with base type {}",
6969
ppaux::ty_to_str(self.tcx, base_type));
7070
match ty::get(base_type).sty {
71-
ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty, ..}) => match ty::get(ty).sty {
72-
ty::ty_str => {
73-
self.tcx.sess.span_err(e.span,
74-
"modification of string types is not allowed");
75-
}
76-
_ => {}
77-
},
78-
ty::ty_str => {
71+
ty::ty_str(..) => {
7972
self.tcx.sess.span_err(e.span,
8073
"modification of string types is not allowed");
8174
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ fn check_heap_type(cx: &Context, span: Span, ty: ty::t) {
911911
ty::ty_box(_) => {
912912
n_box += 1;
913913
}
914-
ty::ty_uniq(_) |
914+
ty::ty_uniq(_) | ty::ty_str(ty::VstoreUniq) |
915915
ty::ty_trait(~ty::TyTrait { store: ty::UniqTraitStore, .. }) |
916916
ty::ty_closure(~ty::ClosureTy { store: ty::UniqTraitStore, .. }) => {
917917
n_uniq += 1;

0 commit comments

Comments
 (0)