Skip to content

Commit 1c2b3cf

Browse files
committed
---
yaml --- r: 112219 b: refs/heads/try c: 829c00c h: refs/heads/master i: 112217: 6a63165 112215: 4102975 v: v3
1 parent fb93bdc commit 1c2b3cf

Some content is hidden

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

41 files changed

+936
-581
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: a692e9b1234ff6573b0cfbc39394d9222eb38f81
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b5dd3f05fe95168b5569d0f519636149479eb6ac
5-
refs/heads/try: 72655677b173c5f77118b2535b22acaa94076f17
5+
refs/heads/try: 829c00cb09ac093307a6edc5bbca92c4ad9dbda2
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/header.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub struct TestProps {
1717
pub error_patterns: Vec<~str> ,
1818
// Extra flags to pass to the compiler
1919
pub compile_flags: Option<~str>,
20+
// Extra flags to pass when the compiled code is run (such as --bench)
21+
pub run_flags: Option<~str>,
2022
// If present, the name of a file that this test should match when
2123
// pretty-printed
2224
pub pp_exact: Option<Path>,
@@ -42,6 +44,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
4244
let mut aux_builds = Vec::new();
4345
let mut exec_env = Vec::new();
4446
let mut compile_flags = None;
47+
let mut run_flags = None;
4548
let mut pp_exact = None;
4649
let mut debugger_cmds = Vec::new();
4750
let mut check_lines = Vec::new();
@@ -58,6 +61,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
5861
compile_flags = parse_compile_flags(ln);
5962
}
6063

64+
if run_flags.is_none() {
65+
run_flags = parse_run_flags(ln);
66+
}
67+
6168
if pp_exact.is_none() {
6269
pp_exact = parse_pp_exact(ln, testfile);
6370
}
@@ -96,9 +103,11 @@ pub fn load_props(testfile: &Path) -> TestProps {
96103

97104
true
98105
});
99-
return TestProps {
106+
107+
TestProps {
100108
error_patterns: error_patterns,
101109
compile_flags: compile_flags,
110+
run_flags: run_flags,
102111
pp_exact: pp_exact,
103112
aux_builds: aux_builds,
104113
exec_env: exec_env,
@@ -107,7 +116,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
107116
force_host: force_host,
108117
check_stdout: check_stdout,
109118
no_prefer_dynamic: no_prefer_dynamic,
110-
};
119+
}
111120
}
112121

113122
pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
@@ -160,6 +169,10 @@ fn parse_compile_flags(line: &str) -> Option<~str> {
160169
parse_name_value_directive(line, "compile-flags".to_owned())
161170
}
162171

172+
fn parse_run_flags(line: &str) -> Option<~str> {
173+
parse_name_value_directive(line, ~"run-flags")
174+
}
175+
163176
fn parse_debugger_cmd(line: &str) -> Option<~str> {
164177
parse_name_value_directive(line, "debugger".to_owned())
165178
}

branches/try/src/compiletest/runtest.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,14 +835,19 @@ fn make_exe_name(config: &config, testfile: &Path) -> Path {
835835
f
836836
}
837837

838-
fn make_run_args(config: &config, _props: &TestProps, testfile: &Path) ->
838+
fn make_run_args(config: &config, props: &TestProps, testfile: &Path) ->
839839
ProcArgs {
840840
// If we've got another tool to run under (valgrind),
841841
// then split apart its command
842842
let mut args = split_maybe_args(&config.runtool);
843843
let exe_file = make_exe_name(config, testfile);
844+
844845
// FIXME (#9639): This needs to handle non-utf8 paths
845846
args.push(exe_file.as_str().unwrap().to_owned());
847+
848+
// Add the arguments in the run_flags directive
849+
args.push_all_move(split_maybe_args(&props.run_flags));
850+
846851
let prog = args.shift().unwrap();
847852
return ProcArgs {prog: prog, args: args};
848853
}

branches/try/src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,8 +1883,8 @@ impl Shape {
18831883

18841884
let s = Circle(Point { x: 1.0, y: 2.0 }, 3.0);
18851885

1886-
(~s).draw_owned();
18871886
(&s).draw_reference();
1887+
(~s).draw_owned();
18881888
s.draw_value();
18891889
~~~
18901890

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! enabled.
1717
//!
1818
//! Features are enabled in programs via the crate-level attributes of
19-
//! #[feature(...)] with a comma-separated list of features.
19+
//! #![feature(...)] with a comma-separated list of features.
2020
2121
use middle::lint;
2222

@@ -324,7 +324,7 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
324324
match attr.meta_item_list() {
325325
None => {
326326
sess.span_err(attr.span, "malformed feature attribute, \
327-
expected #[feature(...)]");
327+
expected #![feature(...)]");
328328
}
329329
Some(list) => {
330330
for &mi in list.iter() {

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ pub fn parse_substs_data(data: &[u8], crate_num: ast::CrateNum, pos: uint, tcx:
137137
parse_substs(&mut st, conv)
138138
}
139139

140-
fn parse_vstore<M>(st: &mut PState, conv: conv_did,
141-
parse_mut: |&mut PState| -> M) -> ty::Vstore<M> {
140+
fn parse_vstore(st: &mut PState, conv: conv_did) -> ty::Vstore {
142141
assert_eq!(next(st), '/');
143142

144143
let c = peek(st);
@@ -150,11 +149,24 @@ fn parse_vstore<M>(st: &mut PState, conv: conv_did,
150149

151150
match next(st) {
152151
'~' => ty::VstoreUniq,
153-
'&' => ty::VstoreSlice(parse_region(st, conv), parse_mut(st)),
152+
'&' => ty::VstoreSlice(parse_region(st, conv)),
154153
c => st.tcx.sess.bug(format!("parse_vstore(): bad input '{}'", c))
155154
}
156155
}
157156

157+
fn parse_size(st: &mut PState) -> Option<uint> {
158+
assert_eq!(next(st), '/');
159+
160+
if peek(st) == '|' {
161+
assert_eq!(next(st), '|');
162+
None
163+
} else {
164+
let n = parse_uint(st);
165+
assert_eq!(next(st), '|');
166+
Some(n)
167+
}
168+
}
169+
158170
fn parse_trait_store(st: &mut PState, conv: conv_did) -> ty::TraitStore {
159171
match next(st) {
160172
'~' => ty::UniqTraitStore,
@@ -342,12 +354,12 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
342354
return ty::mk_rptr(st.tcx, r, mt);
343355
}
344356
'V' => {
345-
let ty = parse_ty(st, |x,y| conv(x,y));
346-
let v = parse_vstore(st, |x,y| conv(x,y), parse_mutability);
347-
return ty::mk_vec(st.tcx, ty, v);
357+
let mt = parse_mt(st, |x,y| conv(x,y));
358+
let sz = parse_size(st);
359+
return ty::mk_vec(st.tcx, mt, sz);
348360
}
349361
'v' => {
350-
let v = parse_vstore(st, |x,y| conv(x,y), |_| ());
362+
let v = parse_vstore(st, |x,y| conv(x,y));
351363
return ty::mk_str(st.tcx, v);
352364
}
353365
'T' => {
@@ -396,7 +408,7 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
396408
assert_eq!(next(st), ']');
397409
return ty::mk_struct(st.tcx, did, substs);
398410
}
399-
c => { error!("unexpected char in type string: {}", c); fail!();}
411+
c => { fail!("unexpected char in type string: {}", c);}
400412
}
401413
}
402414

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,17 @@ fn enc_bound_region(w: &mut MemWriter, cx: &ctxt, br: ty::BoundRegion) {
204204
}
205205
}
206206

207-
pub fn enc_vstore<M>(w: &mut MemWriter, cx: &ctxt,
208-
v: ty::Vstore<M>,
209-
enc_mut: |&mut MemWriter, M|) {
207+
pub fn enc_vstore(w: &mut MemWriter, cx: &ctxt,
208+
v: ty::Vstore,
209+
enc_mut: |&mut MemWriter|) {
210210
mywrite!(w, "/");
211211
match v {
212212
ty::VstoreFixed(u) => mywrite!(w, "{}|", u),
213213
ty::VstoreUniq => mywrite!(w, "~"),
214-
ty::VstoreSlice(r, m) => {
214+
ty::VstoreSlice(r) => {
215215
mywrite!(w, "&");
216216
enc_region(w, cx, r);
217-
enc_mut(w, m);
217+
enc_mut(w);
218218
}
219219
}
220220
}
@@ -292,14 +292,18 @@ fn enc_sty(w: &mut MemWriter, cx: &ctxt, st: &ty::sty) {
292292
enc_region(w, cx, r);
293293
enc_mt(w, cx, mt);
294294
}
295-
ty::ty_vec(ty, v) => {
295+
ty::ty_vec(mt, sz) => {
296296
mywrite!(w, "V");
297-
enc_ty(w, cx, ty);
298-
enc_vstore(w, cx, v, enc_mutability);
297+
enc_mt(w, cx, mt);
298+
mywrite!(w, "/");
299+
match sz {
300+
Some(n) => mywrite!(w, "{}|", n),
301+
None => mywrite!(w, "|"),
302+
}
299303
}
300304
ty::ty_str(v) => {
301305
mywrite!(w, "v");
302-
enc_vstore(w, cx, v, |_, ()| {});
306+
enc_vstore(w, cx, v, |_| {});
303307
}
304308
ty::ty_closure(ref f) => {
305309
mywrite!(w, "f");

0 commit comments

Comments
 (0)