Skip to content

Commit beb0813

Browse files
committed
---
yaml --- r: 193901 b: refs/heads/beta c: b98255c h: refs/heads/master i: 193899: ca2e8f3 v: v3
1 parent 33800ba commit beb0813

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 1e9bef916f471e43fcd18593f95374ac42acf99e
34+
refs/heads/beta: b98255cbd2354c708e3557f26e9cd8f5aec1ed6b
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/src/libcore/result.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ impl<T, E> Result<T, E> {
448448
/// ```
449449
/// use std::old_io::IoResult;
450450
///
451-
/// let mut buffer = &mut b"1\n2\n3\n4\n";
451+
/// let mut buffer: &[u8] = b"1\n2\n3\n4\n";
452+
/// let mut buffer = &mut buffer;
452453
///
453454
/// let mut sum = 0;
454455
///

branches/beta/src/libstd/old_path/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
311311
/// # #[cfg(windows)] fn foo() {}
312312
/// # #[cfg(unix)] fn foo() {
313313
/// let p = Path::new("abc/def/ghi");
314-
/// assert_eq!(p.filename(), Some(b"ghi"));
314+
/// assert_eq!(p.filename(), Some(&b"ghi"[..]));
315315
/// # }
316316
/// ```
317317
fn filename<'a>(&'a self) -> Option<&'a [u8]>;
@@ -345,7 +345,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
345345
/// # #[cfg(windows)] fn foo() {}
346346
/// # #[cfg(unix)] fn foo() {
347347
/// let p = Path::new("/abc/def.txt");
348-
/// assert_eq!(p.filestem(), Some(b"def"));
348+
/// assert_eq!(p.filestem(), Some(&b"def"[..]));
349349
/// # }
350350
/// ```
351351
fn filestem<'a>(&'a self) -> Option<&'a [u8]> {
@@ -392,7 +392,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
392392
/// # #[cfg(windows)] fn foo() {}
393393
/// # #[cfg(unix)] fn foo() {
394394
/// let p = Path::new("abc/def.txt");
395-
/// assert_eq!(p.extension(), Some(b"txt"));
395+
/// assert_eq!(p.extension(), Some(&b"txt"[..]));
396396
/// # }
397397
/// ```
398398
fn extension<'a>(&'a self) -> Option<&'a [u8]> {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
const X1: &'static [u8] = &[b'1'];
12+
const X2: &'static [u8] = b"1";
13+
const X3: &'static [u8; 1] = &[b'1'];
14+
const X4: &'static [u8; 1] = b"1";
15+
16+
static Y1: u8 = X1[0];
17+
static Y2: u8 = X2[0];
18+
static Y3: u8 = X3[0];
19+
static Y4: u8 = X4[0];
20+
21+
fn main() {
22+
assert_eq!(Y1, Y2);
23+
assert_eq!(Y1, Y3);
24+
assert_eq!(Y1, Y4);
25+
}

0 commit comments

Comments
 (0)