Skip to content

Commit 4b4d2f9

Browse files
committed
---
yaml --- r: 137215 b: refs/heads/release-prep c: 80401da h: refs/heads/master i: 137213: d5d9513 137211: 956d5fd 137207: 3b097f0 137199: a1a0053 137183: 1385d39 137151: 2b183f3 137087: 5bb8817 136959: 27850a0 136703: b8daa17 136191: bba4f63 135167: cec7097 v: v3
1 parent 052aae8 commit 4b4d2f9

File tree

13 files changed

+38
-114
lines changed

13 files changed

+38
-114
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2929
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
3030
refs/heads/libuv-update-temp-branch: 6ed22c618766f1f2a2e108eef8ce3f51be0f70b7
3131
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
32-
refs/heads/release-prep: f56c1c91f39b25aaa6453359c0a1da9269d5238f
32+
refs/heads/release-prep: 80401da12e47c6b3cce0e9921980ec49b1b03a10

branches/release-prep/src/libcollections/string.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ impl String {
613613
///
614614
/// # Failure
615615
///
616-
/// Fails if `len` > current length.
616+
/// Fails if `new_len` > current length,
617+
/// or if `new_len` is not a character boundary.
617618
///
618619
/// # Example
619620
///
@@ -624,9 +625,9 @@ impl String {
624625
/// ```
625626
#[inline]
626627
#[unstable = "the failure conventions for strings are under development"]
627-
pub fn truncate(&mut self, len: uint) {
628-
assert!(self.as_slice().is_char_boundary(len));
629-
self.vec.truncate(len)
628+
pub fn truncate(&mut self, new_len: uint) {
629+
assert!(self.as_slice().is_char_boundary(new_len));
630+
self.vec.truncate(new_len)
630631
}
631632

632633
/// Appends a byte to this string buffer.

branches/release-prep/src/libnative/io/c_unix.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,11 @@ mod signal {
232232
pub static SA_SIGINFO: libc::c_int = 0x0040;
233233
pub static SIGCHLD: libc::c_int = 20;
234234

235-
#[cfg(any(target_os = "macos", target_os = "ios"))]
235+
#[cfg(target_os = "macos")]
236+
#[cfg(target_os = "ios")]
236237
pub type sigset_t = u32;
237-
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
238+
#[cfg(target_os = "freebsd")]
239+
#[cfg(target_os = "dragonfly")]
238240
#[repr(C)]
239241
pub struct sigset_t {
240242
bits: [u32, ..4],
@@ -252,7 +254,8 @@ mod signal {
252254
pub status: libc::c_int,
253255
}
254256

255-
#[cfg(any(target_os = "macos", target_os = "ios"))]
257+
#[cfg(target_os = "macos")]
258+
#[cfg(target_os = "ios")]
256259
#[repr(C)]
257260
pub struct sigaction {
258261
pub sa_handler: extern fn(libc::c_int),
@@ -261,7 +264,8 @@ mod signal {
261264
pub sa_flags: libc::c_int,
262265
}
263266

264-
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
267+
#[cfg(target_os = "freebsd")]
268+
#[cfg(target_os = "dragonfly")]
265269
#[repr(C)]
266270
pub struct sigaction {
267271
pub sa_handler: extern fn(libc::c_int),

branches/release-prep/src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: ty::t)
429429
tvec::make_drop_glue_unboxed(bcx, v0, ty, true)
430430
}
431431
ty::ty_str => {
432-
let unit_ty = ty::sequence_element_type(bcx.tcx(), content_ty);
432+
let unit_ty = ty::sequence_element_type(bcx.tcx(), t);
433433
tvec::make_drop_glue_unboxed(bcx, v0, unit_ty, true)
434434
}
435435
ty::ty_trait(..) => {

branches/release-prep/src/librustc/middle/typeck/check/_match.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -670,30 +670,30 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
670670
(ty, default_region_var, ast::MutImmutable, None)
671671
}
672672
_ => {
673-
check_err("an array pattern".to_string());
673+
check_err("a vector pattern".to_string());
674674
return;
675675
}
676676
},
677677
ty::ty_rptr(r, mt) => match ty::get(mt.ty).sty {
678678
ty::ty_vec(ty, None) => (ty, r, mt.mutbl, None),
679679
_ => {
680-
check_err("an array pattern".to_string());
680+
check_err("a vector pattern".to_string());
681681
return;
682682
}
683683
},
684684
_ => {
685-
check_err("an array pattern".to_string());
685+
check_err("a vector pattern".to_string());
686686
return;
687687
}
688688
};
689689

690690
let min_len = before.len() + after.len();
691691
fixed.and_then(|count| match *slice {
692692
Some(_) if count < min_len =>
693-
Some(format!("a fixed array pattern of size at least {}", min_len)),
693+
Some(format!("a fixed vector pattern of size at least {}", min_len)),
694694

695695
None if count != min_len =>
696-
Some(format!("a fixed array pattern of size {}", min_len)),
696+
Some(format!("a fixed vector pattern of size {}", min_len)),
697697

698698
_ => None
699699
}).map(check_err);

branches/release-prep/src/librustc/middle/typeck/check/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5004,14 +5004,9 @@ pub fn check_enum_variants(ccx: &CrateCtxt,
50045004
};
50055005

50065006
// Check for duplicate discriminant values
5007-
match disr_vals.iter().position(|&x| x == current_disr_val) {
5008-
Some(i) => {
5009-
span_err!(ccx.tcx.sess, v.span, E0081,
5010-
"discriminant value `{}` already exists", disr_vals[i]);
5011-
span_note!(ccx.tcx.sess, ccx.tcx().map.span(variants[i].id.node),
5012-
"conflicting discriminant here")
5013-
}
5014-
None => {}
5007+
if disr_vals.contains(&current_disr_val) {
5008+
span_err!(ccx.tcx.sess, v.span, E0081,
5009+
"discriminant value already exists");
50155010
}
50165011
// Check for unrepresentable discriminant values
50175012
match hint {

branches/release-prep/src/libsyntax/test.rs

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -274,43 +274,30 @@ fn strip_test_functions(krate: ast::Crate) -> ast::Crate {
274274
fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
275275
let has_test_attr = attr::contains_name(i.attrs.as_slice(), "test");
276276

277-
#[deriving(PartialEq)]
278-
enum HasTestSignature {
279-
Yes,
280-
No,
281-
NotEvenAFunction,
282-
}
283-
284-
fn has_test_signature(i: &ast::Item) -> HasTestSignature {
277+
fn has_test_signature(i: &ast::Item) -> bool {
285278
match &i.node {
286279
&ast::ItemFn(ref decl, _, _, ref generics, _) => {
287280
let no_output = match decl.output.node {
288281
ast::TyNil => true,
289-
_ => false,
282+
_ => false
290283
};
291-
if decl.inputs.is_empty()
292-
&& no_output
293-
&& !generics.is_parameterized() {
294-
Yes
295-
} else {
296-
No
297-
}
284+
decl.inputs.is_empty()
285+
&& no_output
286+
&& !generics.is_parameterized()
298287
}
299-
_ => NotEvenAFunction,
288+
_ => false
300289
}
301290
}
302291

303-
if has_test_attr {
292+
if has_test_attr && !has_test_signature(i) {
304293
let diag = cx.span_diagnostic;
305-
match has_test_signature(i) {
306-
Yes => {},
307-
No => diag.span_err(i.span, "functions used as tests must have signature fn() -> ()"),
308-
NotEvenAFunction => diag.span_err(i.span,
309-
"only functions may be used as tests"),
310-
}
294+
diag.span_err(
295+
i.span,
296+
"functions used as tests must have signature fn() -> ()."
297+
);
311298
}
312299

313-
return has_test_attr && has_test_signature(i) == Yes;
300+
return has_test_attr && has_test_signature(i);
314301
}
315302

316303
fn is_bench_fn(cx: &TestCtxt, i: &ast::Item) -> bool {

branches/release-prep/src/test/compile-fail/issue-13482.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
let x = [1,2];
1313
let y = match x {
1414
[] => None,
15-
//~^ ERROR expected `[<generic integer #0>, ..2]`, found a fixed array pattern of size 0
15+
//~^ ERROR expected `[<generic integer #0>, ..2]`, found a fixed vector pattern of size 0
1616
[a,_] => Some(a)
1717
};
1818
}

branches/release-prep/src/test/compile-fail/issue-14772.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

branches/release-prep/src/test/compile-fail/issue-15524.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

branches/release-prep/src/test/compile-fail/match-vec-mismatch-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
fn main() {
1212
match () {
13-
[()] => { } //~ ERROR mismatched types: expected `()`, found an array pattern
13+
[()] => { } //~ ERROR mismatched types: expected `()`, found a vector pattern
1414
}
1515
}

branches/release-prep/src/test/compile-fail/tag-variant-disr-dup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//error-pattern:discriminant value
11+
//error-pattern:discriminant value already exists
1212

1313
// black and white have the same discriminator value ...
1414

branches/release-prep/src/test/run-pass/issue-17734.rs

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)