Skip to content

Commit 6ca5552

Browse files
committed
---
yaml --- r: 104561 b: refs/heads/try c: 9083cb2 h: refs/heads/master i: 104559: 006e0db v: v3
1 parent 06cb6f8 commit 6ca5552

File tree

8 files changed

+58
-18
lines changed

8 files changed

+58
-18
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: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5-
refs/heads/try: 5737d1f70459d03b219c8dadb8ac71c26e7e49d8
5+
refs/heads/try: 9083cb24b2739e04ea1e0a90a14740939f8cfeed
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,11 +2786,11 @@ src/animals.rs
27862786
27872787
src/mammals/humans.rs
27882788
src/mammals/humans/mod.rs
2789-
~~~
2789+
~~
27902790
27912791
If the animals file is `src/animals/mod.rs`, `rustc` will look for:
27922792
2793-
~~~ {.notrust}
2793+
~~ {.notrust}
27942794
src/animals/mod.rs
27952795
src/animals/fish.rs
27962796
src/animals/fish/mod.rs

branches/try/src/librustc/middle/kind.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ pub fn check_expr(cx: &mut Context, e: &Expr) {
315315
match e.node {
316316
ExprUnary(UnBox, interior) => {
317317
let interior_type = ty::expr_ty(cx.tcx, interior);
318-
let _ = check_durable(cx.tcx, interior_type, interior.span);
318+
let _ = check_static(cx.tcx, interior_type, interior.span);
319319
}
320320
ExprCast(source, _) => {
321321
let source_ty = ty::expr_ty(cx.tcx, source);
@@ -474,13 +474,13 @@ pub fn check_send(cx: &Context, ty: ty::t, sp: Span) -> bool {
474474
}
475475
}
476476

477-
// note: also used from middle::typeck::regionck!
478-
pub fn check_durable(tcx: ty::ctxt, ty: ty::t, sp: Span) -> bool {
477+
pub fn check_static(tcx: ty::ctxt, ty: ty::t, sp: Span) -> bool {
479478
if !ty::type_is_static(tcx, ty) {
480479
match ty::get(ty).sty {
481480
ty::ty_param(..) => {
482-
tcx.sess.span_err(sp, "value may contain references; \
483-
add `'static` bound");
481+
tcx.sess.span_err(sp,
482+
format!("value may contain references; \
483+
add `'static` bound to `{}`", ty_to_str(tcx, ty)));
484484
}
485485
_ => {
486486
tcx.sess.span_err(sp, "value may contain references");
@@ -578,7 +578,7 @@ pub fn check_cast_for_escaping_regions(
578578
if target_params.iter().any(|x| x == &source_param) {
579579
/* case (2) */
580580
} else {
581-
check_durable(cx.tcx, ty, source_span); /* case (3) */
581+
check_static(cx.tcx, ty, source_span); /* case (3) */
582582
}
583583
}
584584
_ => {}

branches/try/src/libstd/io/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,32 +214,46 @@ pub use self::buffered::{BufferedReader, BufferedWriter, BufferedStream,
214214
LineBufferedWriter};
215215
pub use self::comm_adapters::{PortReader, ChanWriter};
216216

217+
/// Various utility functions useful for writing I/O tests
217218
pub mod test;
218219

220+
/// Synchronous, non-blocking filesystem operations.
219221
pub mod fs;
220222

223+
/// Synchronous, in-memory I/O.
221224
pub mod pipe;
222225

226+
/// Child process management.
223227
pub mod process;
224228

229+
/// Synchronous, non-blocking network I/O.
225230
pub mod net;
226231

232+
/// Readers and Writers for memory buffers and strings.
227233
mod mem;
228234

235+
/// Non-blocking access to stdin, stdout, stderr
229236
pub mod stdio;
230237

238+
/// Implementations for Result
231239
mod result;
232240

241+
/// Extension traits
233242
pub mod extensions;
234243

244+
/// Basic Timer
235245
pub mod timer;
236246

247+
/// Buffered I/O wrappers
237248
mod buffered;
238249

250+
/// Signal handling
239251
pub mod signal;
240252

253+
/// Utility implementations of Reader and Writer
241254
pub mod util;
242255

256+
/// Adapatation of Chan/Port types to a Writer/Reader type.
243257
mod comm_adapters;
244258

245259
/// The default buffer size for various I/O operations

branches/try/src/libstd/io/stdio.rs

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

11-
/*! Non-blocking access to stdin, stdout, and stderr.
11+
/*!
1212
13-
This module provides bindings to the local event loop's TTY interface, using it
14-
to offer synchronous but non-blocking versions of stdio. These handles can be
15-
inspected for information about terminal dimensions or for related information
16-
about the stream or terminal to which it is attached.
13+
This modules provides bindings to the local event loop's TTY interface, using it
14+
to have synchronous, but non-blocking versions of stdio. These handles can be
15+
inspected for information about terminal dimensions or related information
16+
about the stream or terminal that it is attached to.
1717
1818
# Example
1919

branches/try/src/libstd/io/test.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/*! Various utility functions useful for writing I/O tests */
12-
1311
#[macro_escape];
1412

1513
use os;

branches/try/src/libstd/io/util.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/*! Utility implementations of Reader and Writer */
12-
1311
use prelude::*;
1412
use cmp;
1513
use io;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2014 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+
trait A<T> {}
12+
struct B<'a, T>(&'a A<T>);
13+
14+
trait X {}
15+
impl<'a, T> X for B<'a, T> {}
16+
17+
fn f<'a, T, U>(v: ~A<T>) -> ~X: {
18+
~B(v) as ~X: //~ ERROR value may contain references; add `'static` bound to `T`
19+
}
20+
21+
fn g<'a, T, U>(v: ~A<U>) -> ~X: {
22+
~B(v) as ~X: //~ ERROR value may contain references; add `'static` bound to `U`
23+
}
24+
25+
fn h<'a, T: 'static>(v: ~A<T>) -> ~X: {
26+
~B(v) as ~X: // ok
27+
}
28+
29+
fn main() {}
30+

0 commit comments

Comments
 (0)