Skip to content

Commit 63dcad0

Browse files
committed
---
yaml --- r: 191402 b: refs/heads/try c: b98255c h: refs/heads/master v: v3
1 parent 136dd8a commit 63dcad0

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 809a554fca2d0ebc2ba50077016fe282a4064752
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c64d671671aea2e44ee7fc6eb00ee75fc30ed7b9
5-
refs/heads/try: 1e9bef916f471e43fcd18593f95374ac42acf99e
5+
refs/heads/try: b98255cbd2354c708e3557f26e9cd8f5aec1ed6b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/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/try/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)