Skip to content

Commit 4f52cca

Browse files
committed
---
yaml --- r: 134110 b: refs/heads/master c: 852cef8 h: refs/heads/master v: v3
1 parent e609fff commit 4f52cca

Some content is hidden

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

72 files changed

+603
-1081
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 43fd619819b334b8548dca98797bd4c8078636cb
2+
refs/heads/master: 852cef8a93329a43b152123eadd65acf880f4fcf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 437179ed8bf7f7672f84b19265df1ce569e70490
55
refs/heads/try: 777654cfccbfa39bc7f671d8e9629018ed8ca12d

trunk/CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ If you're just reporting a bug, please see:
44

55
http://doc.rust-lang.org/complement-bugreport.html
66

7+
## Submitting an issue
8+
9+
Please submit issues here for bug reports or implementation details. For feature
10+
requests, language changes, or major changes to the libraries, please submit an
11+
issue against the [RFCs repository](https://github.com/rust-lang/rfcs).
12+
713
## Pull request procedure
814

915
Pull requests should be targeted at Rust's `master` branch.

trunk/src/compiletest/runtest.rs

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
273273
format!("--target={}", config.target),
274274
"-L".to_string(),
275275
aux_dir.as_str().unwrap().to_string());
276-
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
277-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
276+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
277+
args.push_all_move(split_maybe_args(&props.compile_flags));
278278
return ProcArgs {
279279
prog: config.rustc_path.as_str().unwrap().to_string(),
280280
args: args,
@@ -321,8 +321,8 @@ actual:\n\
321321
config.build_base.as_str().unwrap().to_string(),
322322
"-L".to_string(),
323323
aux_dir.as_str().unwrap().to_string());
324-
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
325-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
324+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
325+
args.push_all_move(split_maybe_args(&props.compile_flags));
326326
// FIXME (#9639): This needs to handle non-utf8 paths
327327
return ProcArgs {
328328
prog: config.rustc_path.as_str().unwrap().to_string(),
@@ -1095,12 +1095,11 @@ fn compile_test_(config: &Config, props: &TestProps,
10951095
testfile: &Path, extra_args: &[String]) -> ProcRes {
10961096
let aux_dir = aux_output_dir_name(config, testfile);
10971097
// FIXME (#9639): This needs to handle non-utf8 paths
1098-
let mut link_args = vec!("-L".to_string(),
1099-
aux_dir.as_str().unwrap().to_string());
1100-
link_args.extend(extra_args.iter().map(|s| s.clone()));
1098+
let link_args = vec!("-L".to_string(),
1099+
aux_dir.as_str().unwrap().to_string());
11011100
let args = make_compile_args(config,
11021101
props,
1103-
link_args,
1102+
link_args.append(extra_args),
11041103
|a, b| ThisFile(make_exe_name(a, b)), testfile);
11051104
compose_and_run_compiler(config, props, testfile, args, None)
11061105
}
@@ -1147,16 +1146,16 @@ fn compose_and_run_compiler(
11471146
for rel_ab in props.aux_builds.iter() {
11481147
let abs_ab = config.aux_base.join(rel_ab.as_slice());
11491148
let aux_props = header::load_props(&abs_ab);
1150-
let mut crate_type = if aux_props.no_prefer_dynamic {
1149+
let crate_type = if aux_props.no_prefer_dynamic {
11511150
Vec::new()
11521151
} else {
11531152
vec!("--crate-type=dylib".to_string())
11541153
};
1155-
crate_type.extend(extra_link_args.clone().into_iter());
11561154
let aux_args =
11571155
make_compile_args(config,
11581156
&aux_props,
1159-
crate_type,
1157+
crate_type.append(
1158+
extra_link_args.as_slice()),
11601159
|a,b| {
11611160
let f = make_lib_name(a, b, testfile);
11621161
ThisDirectory(f.dir_path())
@@ -1247,11 +1246,11 @@ fn make_compile_args(config: &Config,
12471246
};
12481247
args.push(path.as_str().unwrap().to_string());
12491248
if props.force_host {
1250-
args.extend(split_maybe_args(&config.host_rustcflags).into_iter());
1249+
args.push_all_move(split_maybe_args(&config.host_rustcflags));
12511250
} else {
1252-
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
1251+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
12531252
}
1254-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
1253+
args.push_all_move(split_maybe_args(&props.compile_flags));
12551254
return ProcArgs {
12561255
prog: config.rustc_path.as_str().unwrap().to_string(),
12571256
args: args,
@@ -1268,9 +1267,10 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> Path {
12681267
fn make_exe_name(config: &Config, testfile: &Path) -> Path {
12691268
let mut f = output_base_name(config, testfile);
12701269
if !os::consts::EXE_SUFFIX.is_empty() {
1271-
let mut fname = f.filename().unwrap().to_vec();
1272-
fname.extend(os::consts::EXE_SUFFIX.bytes());
1273-
f.set_filename(fname);
1270+
match f.filename().map(|s| Vec::from_slice(s).append(os::consts::EXE_SUFFIX.as_bytes())) {
1271+
Some(v) => f.set_filename(v),
1272+
None => ()
1273+
}
12741274
}
12751275
f
12761276
}
@@ -1286,7 +1286,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path) ->
12861286
args.push(exe_file.as_str().unwrap().to_string());
12871287

12881288
// Add the arguments in the run_flags directive
1289-
args.extend(split_maybe_args(&props.run_flags).into_iter());
1289+
args.push_all_move(split_maybe_args(&props.run_flags));
12901290

12911291
let prog = args.remove(0).unwrap();
12921292
return ProcArgs {
@@ -1381,10 +1381,12 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> Path {
13811381
}
13821382

13831383
fn aux_output_dir_name(config: &Config, testfile: &Path) -> Path {
1384-
let f = output_base_name(config, testfile);
1385-
let mut fname = f.filename().unwrap().to_vec();
1386-
fname.extend("libaux".bytes());
1387-
f.with_filename(fname)
1384+
let mut f = output_base_name(config, testfile);
1385+
match f.filename().map(|s| Vec::from_slice(s).append(b".libaux")) {
1386+
Some(v) => f.set_filename(v),
1387+
None => ()
1388+
}
1389+
f
13881390
}
13891391

13901392
fn output_testname(testfile: &Path) -> Path {
@@ -1596,25 +1598,22 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> Path {
15961598
if suffix.len() == 0 {
15971599
(*p).clone()
15981600
} else {
1599-
let mut stem = p.filestem().unwrap().to_vec();
1600-
stem.extend("-".bytes());
1601-
stem.extend(suffix.bytes());
1602-
p.with_filename(stem)
1601+
let stem = p.filestem().unwrap();
1602+
p.with_filename(Vec::from_slice(stem).append(b"-").append(suffix.as_bytes()))
16031603
}
16041604
}
16051605

16061606
fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
16071607
testfile: &Path) -> ProcRes {
16081608
let aux_dir = aux_output_dir_name(config, testfile);
16091609
// FIXME (#9639): This needs to handle non-utf8 paths
1610-
let mut link_args = vec!("-L".to_string(),
1611-
aux_dir.as_str().unwrap().to_string());
1610+
let link_args = vec!("-L".to_string(),
1611+
aux_dir.as_str().unwrap().to_string());
16121612
let llvm_args = vec!("--emit=bc,obj".to_string(),
16131613
"--crate-type=lib".to_string());
1614-
link_args.extend(llvm_args.into_iter());
16151614
let args = make_compile_args(config,
16161615
props,
1617-
link_args,
1616+
link_args.append(llvm_args.as_slice()),
16181617
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
16191618
testfile);
16201619
compose_and_run_compiler(config, props, testfile, args, None)

trunk/src/doc/rust.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,9 +3833,8 @@ fn map<A: Clone, B: Clone>(f: |A| -> B, xs: &[A]) -> Vec<B> {
38333833
return vec![];
38343834
}
38353835
let first: B = f(xs[0].clone());
3836-
let mut rest: Vec<B> = map(f, xs.slice(1, xs.len()));
3837-
rest.insert(0, first);
3838-
return rest;
3836+
let rest: Vec<B> = map(f, xs.slice(1, xs.len()));
3837+
return vec![first].append(rest.as_slice());
38393838
}
38403839
~~~~
38413840

trunk/src/etc/vim/indent/rust.vim

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim indent file
22
" Language: Rust
33
" Author: Chris Morgan <[email protected]>
4-
" Last Change: 2014 Sep 13
4+
" Last Change: 2013 Oct 29
55

66
" Only load this indent file when no other was loaded.
77
if exists("b:did_indent")
@@ -10,7 +10,7 @@ endif
1010
let b:did_indent = 1
1111

1212
setlocal cindent
13-
setlocal cinoptions=L0,(0,Ws,J1,j1
13+
setlocal cinoptions=L0,(0,Ws,JN,j1
1414
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
1515
" Don't think cinwords will actually do anything at all... never mind
1616
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern
@@ -151,42 +151,40 @@ function GetRustIndent(lnum)
151151
"
152152
" There are probably other cases where we don't want to do this as
153153
" well. Add them as needed.
154-
return indent(prevlinenum)
154+
return GetRustIndent(a:lnum - 1)
155155
endif
156156

157-
if !has("patch-7.4.355")
158-
" cindent before 7.4.355 doesn't do the module scope well at all; e.g.::
159-
"
160-
" static FOO : &'static [bool] = [
161-
" true,
162-
" false,
163-
" false,
164-
" true,
165-
" ];
166-
"
167-
" uh oh, next statement is indented further!
157+
" cindent doesn't do the module scope well at all; e.g.::
158+
"
159+
" static FOO : &'static [bool] = [
160+
" true,
161+
" false,
162+
" false,
163+
" true,
164+
" ];
165+
"
166+
" uh oh, next statement is indented further!
168167

169-
" Note that this does *not* apply the line continuation pattern properly;
170-
" that's too hard to do correctly for my liking at present, so I'll just
171-
" start with these two main cases (square brackets and not returning to
172-
" column zero)
168+
" Note that this does *not* apply the line continuation pattern properly;
169+
" that's too hard to do correctly for my liking at present, so I'll just
170+
" start with these two main cases (square brackets and not returning to
171+
" column zero)
173172

174-
call cursor(a:lnum, 1)
175-
if searchpair('{\|(', '', '}\|)', 'nbW',
173+
call cursor(a:lnum, 1)
174+
if searchpair('{\|(', '', '}\|)', 'nbW',
175+
\ 's:is_string_comment(line("."), col("."))') == 0
176+
if searchpair('\[', '', '\]', 'nbW',
176177
\ 's:is_string_comment(line("."), col("."))') == 0
177-
if searchpair('\[', '', '\]', 'nbW',
178-
\ 's:is_string_comment(line("."), col("."))') == 0
179-
" Global scope, should be zero
178+
" Global scope, should be zero
179+
return 0
180+
else
181+
" At the module scope, inside square brackets only
182+
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
183+
if line =~ "^\\s*]"
184+
" It's the closing line, dedent it
180185
return 0
181186
else
182-
" At the module scope, inside square brackets only
183-
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
184-
if line =~ "^\\s*]"
185-
" It's the closing line, dedent it
186-
return 0
187-
else
188-
return &shiftwidth
189-
endif
187+
return &shiftwidth
190188
endif
191189
endif
192190
endif

trunk/src/liballoc/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ mod tests {
311311

312312
task::spawn(proc() {
313313
let arc_v: Arc<Vec<int>> = rx.recv();
314-
assert_eq!((*arc_v)[3], 4);
314+
assert_eq!(*arc_v.get(3), 4);
315315
});
316316

317317
tx.send(arc_v.clone());
318318

319-
assert_eq!((*arc_v)[2], 3);
320-
assert_eq!((*arc_v)[4], 5);
319+
assert_eq!(*arc_v.get(2), 3);
320+
assert_eq!(*arc_v.get(4), 5);
321321

322322
info!("{:?}", arc_v);
323323
}

trunk/src/libcollections/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ impl Bitv {
631631
let old_size = self.storage.len();
632632
let size = (size + uint::BITS - 1) / uint::BITS;
633633
if old_size < size {
634-
self.storage.grow(size - old_size, 0);
634+
self.storage.grow(size - old_size, &0);
635635
}
636636
}
637637

@@ -687,7 +687,7 @@ impl Bitv {
687687
// Allocate new words, if needed
688688
if new_nwords > self.storage.len() {
689689
let to_add = new_nwords - self.storage.len();
690-
self.storage.grow(to_add, full_value);
690+
self.storage.grow(to_add, &full_value);
691691
}
692692
// Adjust internal bit count
693693
self.nbits = new_nbits;

trunk/src/libcollections/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub trait MutableMap<K, V>: Map<K, V> + Mutable {
131131
/// let mut map = HashMap::new();
132132
/// assert_eq!(map.insert("key", 2i), true);
133133
/// assert_eq!(map.insert("key", 9i), false);
134-
/// assert_eq!(map["key"], 9i);
134+
/// assert_eq!(map.get(&"key"), &9i);
135135
/// ```
136136
#[inline]
137137
fn insert(&mut self, key: K, value: V) -> bool {
@@ -171,7 +171,7 @@ pub trait MutableMap<K, V>: Map<K, V> + Mutable {
171171
///
172172
/// map.insert("a", 1i);
173173
/// assert_eq!(map.swap("a", 37i), Some(1i));
174-
/// assert_eq!(map["a"], 37i);
174+
/// assert_eq!(map.get(&"a"), &37i);
175175
/// ```
176176
fn swap(&mut self, k: K, v: V) -> Option<V>;
177177

@@ -203,7 +203,7 @@ pub trait MutableMap<K, V>: Map<K, V> + Mutable {
203203
/// Some(x) => *x = 7i,
204204
/// None => (),
205205
/// }
206-
/// assert_eq!(map["a"], 7i);
206+
/// assert_eq!(map.get(&"a"), &7i);
207207
/// ```
208208
fn find_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V>;
209209
}

trunk/src/libcollections/ringbuf.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ mod tests {
542542
use vec::Vec;
543543

544544
#[test]
545-
#[allow(deprecated)]
546545
fn test_simple() {
547546
let mut d = RingBuf::new();
548547
assert_eq!(d.len(), 0u);
@@ -588,7 +587,6 @@ mod tests {
588587
}
589588

590589
#[test]
591-
#[allow(deprecated)]
592590
fn test_boxes() {
593591
let a: Gc<int> = box(GC) 5;
594592
let b: Gc<int> = box(GC) 72;

0 commit comments

Comments
 (0)