Skip to content

Commit e3a4d63

Browse files
committed
---
yaml --- r: 73263 b: refs/heads/dist-snap c: dcc2879 h: refs/heads/master i: 73261: 83e4f50 73259: 644399d 73255: 2960a4c 73247: 6acf6b2 v: v3
1 parent e0d4aa5 commit e3a4d63

File tree

18 files changed

+34
-91
lines changed

18 files changed

+34
-91
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: d3f70b141a43ebe02dcb3d62ffe2ae42da561aad
10+
refs/heads/dist-snap: dcc2879266ee6e733a4729b425da0ff25aeebd1f
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/io.rs

Lines changed: 13 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,29 @@ pub trait Reader {
8484

8585
// FIXME (#2982): This should probably return an error.
8686
/**
87-
* Reads bytes and puts them into `bytes`. Returns the number of
88-
* bytes read.
87+
* Reads bytes and puts them into `bytes`, advancing the cursor. Returns the
88+
* number of bytes read.
8989
*
9090
* The number of bytes to be read is `len` or the end of the file,
9191
* whichever comes first.
9292
*
9393
* The buffer must be at least `len` bytes long.
9494
*
95+
* `read` is conceptually similar to C's `fread` function.
96+
*
9597
* # Examples
9698
*
9799
* None right now.
98100
*/
99101
fn read(&self, bytes: &mut [u8], len: uint) -> uint;
100102

101103
/**
102-
* Reads a single byte.
104+
* Reads a single byte, advancing the cursor.
103105
*
104106
* In the case of an EOF or an error, returns a negative value.
105107
*
108+
* `read_byte` is conceptually similar to C's `getc` function.
109+
*
106110
* # Examples
107111
*
108112
* None right now.
@@ -112,6 +116,8 @@ pub trait Reader {
112116
/**
113117
* Returns a boolean value: are we currently at EOF?
114118
*
119+
* `eof` is conceptually similar to C's `feof` function.
120+
*
115121
* # Examples
116122
*
117123
* None right now.
@@ -124,6 +130,8 @@ pub trait Reader {
124130
* Takes an optional SeekStyle, which affects how we seek from the
125131
* position. See `SeekStyle` docs for more details.
126132
*
133+
* `seek` is conceptually similar to C's `fseek` function.
134+
*
127135
* # Examples
128136
*
129137
* None right now.
@@ -133,6 +141,8 @@ pub trait Reader {
133141
/**
134142
* Returns the current position within the stream.
135143
*
144+
* `tell` is conceptually similar to C's `ftell` function.
145+
*
136146
* # Examples
137147
*
138148
* None right now.
@@ -1010,16 +1020,6 @@ pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
10101020
// top-level functions that take a reader, or a set of default methods on
10111021
// reader (which can then be called reader)
10121022

1013-
/**
1014-
* Gives a `Reader` that allows you to read values from standard input.
1015-
*
1016-
* # Examples
1017-
* ~~~
1018-
* let stdin = core::io::stdin();
1019-
* let line = stdin.read_line();
1020-
* core::io::print(line);
1021-
* ~~~
1022-
*/
10231023
pub fn stdin() -> @Reader {
10241024
unsafe {
10251025
@rustrt::rust_get_stdin() as @Reader
@@ -1571,57 +1571,13 @@ pub fn buffered_file_writer(path: &Path) -> Result<@Writer, ~str> {
15711571
// FIXME (#2004) it would be great if this could be a const
15721572
// FIXME (#2004) why are these different from the way stdin() is
15731573
// implemented?
1574-
1575-
1576-
/**
1577-
* Gives a `Writer` which allows you to write to the standard output.
1578-
*
1579-
* # Examples
1580-
* ~~~
1581-
* let stdout = core::io::stdout();
1582-
* stdout.write_str("hello\n");
1583-
* ~~~
1584-
*/
15851574
pub fn stdout() -> @Writer { fd_writer(libc::STDOUT_FILENO as c_int, false) }
1586-
1587-
/**
1588-
* Gives a `Writer` which allows you to write to standard error.
1589-
*
1590-
* # Examples
1591-
* ~~~
1592-
* let stderr = core::io::stderr();
1593-
* stderr.write_str("hello\n");
1594-
* ~~~
1595-
*/
15961575
pub fn stderr() -> @Writer { fd_writer(libc::STDERR_FILENO as c_int, false) }
15971576
1598-
/**
1599-
* Prints a string to standard output.
1600-
*
1601-
* This string will not have an implicit newline at the end. If you want
1602-
* an implicit newline, please see `println`.
1603-
*
1604-
* # Examples
1605-
* ~~~
1606-
* // print is imported into the prelude, and so is always available.
1607-
* print("hello");
1608-
* ~~~
1609-
*/
16101577
pub fn print(s: &str) {
16111578
stdout().write_str(s);
16121579
}
16131580
1614-
/**
1615-
* Prints a string to standard output, followed by a newline.
1616-
*
1617-
* If you do not want an implicit newline, please see `print`.
1618-
*
1619-
* # Examples
1620-
* ~~~
1621-
* // println is imported into the prelude, and so is always available.
1622-
* println("hello");
1623-
* ~~~
1624-
*/
16251581
pub fn println(s: &str) {
16261582
stdout().write_line(s);
16271583
}

branches/dist-snap/src/libcore/rt/uv/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
273273
ECONNREFUSED => ConnectionRefused,
274274
ECONNRESET => ConnectionReset,
275275
EPIPE => BrokenPipe,
276-
_ => {
277-
rtdebug!("uverr.code %u", uverr.code as uint);
276+
e => {
277+
rtdebug!("e %u", e as uint);
278278
// XXX: Need to map remaining uv error types
279279
OtherIoError
280280
}

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -386,20 +386,8 @@ fn encode_reexported_static_methods(ecx: @EncodeContext,
386386
match ecx.tcx.trait_methods_cache.find(&exp.def_id) {
387387
Some(methods) => {
388388
match ecx.tcx.items.find(&exp.def_id.node) {
389-
Some(&ast_map::node_item(item, path)) => {
390-
let original_name = ecx.tcx.sess.str_of(item.ident);
391-
392-
//
393-
// We don't need to reexport static methods on traits
394-
// declared in the same module as our `pub use ...` since
395-
// that's done when we encode the trait item.
396-
//
397-
// The only exception is when the reexport *changes* the
398-
// name e.g. `pub use Foo = self::Bar` -- we have
399-
// encoded metadata for static methods relative to Bar,
400-
// but not yet for Foo.
401-
//
402-
if mod_path != *path || *exp.name != *original_name {
389+
Some(&ast_map::node_item(_, path)) => {
390+
if mod_path != *path {
403391
for methods.each |&m| {
404392
if m.explicit_self == ast::sty_static {
405393
encode_reexported_static_method(ecx,

branches/dist-snap/src/librustc/middle/borrowck/gather_loans/lifetime.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//! This module implements the check that the lifetime of a borrow
1212
//! does not exceed the lifetime of the value being borrowed.
1313
14+
use core::prelude::*;
1415
use middle::borrowck::*;
1516
use mc = middle::mem_categorization;
1617
use middle::ty;

branches/dist-snap/src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// their associated scopes. In phase two, checking loans, we will then make
1717
// sure that all of these loans are honored.
1818

19+
use core::prelude::*;
20+
1921
use middle::borrowck::*;
2022
use mc = middle::mem_categorization;
2123
use middle::pat_util;

branches/dist-snap/src/librustc/middle/borrowck/gather_loans/restrictions.rs

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

1111
//! Computes the restrictions that result from a borrow.
1212
13+
use core::prelude::*;
1314
use middle::borrowck::*;
1415
use mc = middle::mem_categorization;
1516
use middle::ty;

branches/dist-snap/src/librustc/middle/borrowck/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/*! See doc.rs for a thorough explanation of the borrow checker */
1212

13+
use core::prelude::*;
14+
1315
use mc = middle::mem_categorization;
1416
use middle::ty;
1517
use middle::typeck;

branches/dist-snap/src/librustc/middle/dataflow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* GEN and KILL bits for each expression.
1717
*/
1818

19+
use core::prelude::*;
1920
use core::cast;
2021
use core::uint;
2122
use syntax::ast;

branches/dist-snap/src/librustc/middle/trans/consts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use util::ppaux::{Repr, ty_to_str};
2727

2828
use core::libc::c_uint;
2929
use syntax::{ast, ast_util, ast_map};
30+
use util::ppaux::ty_to_str;
3031

3132
pub fn const_lit(cx: @CrateContext, e: @ast::expr, lit: ast::lit)
3233
-> ValueRef {

branches/dist-snap/src/librustc/middle/trans/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ use middle::trans::type_of;
145145
use middle::ty::struct_fields;
146146
use middle::ty::{AutoDerefRef, AutoAddEnv};
147147
use middle::ty::{AutoPtr, AutoBorrowVec, AutoBorrowVecRef, AutoBorrowFn,
148-
AutoUnsafe};
148+
AutoDerefRef, AutoAddEnv, AutoUnsafe};
149149
use middle::ty;
150150
use util::common::indenter;
151151
use util::ppaux::Repr;

branches/dist-snap/src/librustc/middle/typeck/infer/combine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use middle::typeck::infer::glb::Glb;
6262
use middle::typeck::infer::lub::Lub;
6363
use middle::typeck::infer::sub::Sub;
6464
use middle::typeck::infer::to_str::InferStr;
65-
use middle::typeck::infer::{cres, InferCtxt, ures};
65+
use middle::typeck::infer::{cres, InferCtxt, ures, IntType, UintType};
6666
use util::common::indent;
6767

6868
use core::result::{iter_vec2, map_vec2};

branches/dist-snap/src/librustc/middle/typeck/infer/lattice.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ use middle::typeck::infer::glb::Glb;
4141
use middle::typeck::infer::lub::Lub;
4242
use middle::typeck::infer::unify::*;
4343
use middle::typeck::infer::sub::Sub;
44+
use middle::typeck::infer::lub::Lub;
45+
use middle::typeck::infer::glb::Glb;
4446
use middle::typeck::infer::to_str::InferStr;
4547
use util::common::indenter;
4648

branches/dist-snap/src/librustpkg/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc::driver::{driver, session};
1616
use rustc::metadata::filesearch;
1717
use std::getopts::groups::getopts;
1818
use std::semver;
19-
use std::term;
19+
use std::{term, getopts};
2020
use syntax::ast_util::*;
2121
use syntax::codemap::{dummy_sp, spanned, dummy_spanned};
2222
use syntax::ext::base::{mk_ctxt, ext_ctxt};

branches/dist-snap/src/libsyntax/opt_vec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* other useful things like `push()` and `len()`.
1717
*/
1818

19+
use core::prelude::*;
1920
use core::old_iter;
2021
use core::old_iter::BaseIter;
2122

branches/dist-snap/src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ use ast::{expr_ret, expr_self, expr_struct, expr_tup, expr_unary};
3030
use ast::{expr_vec, expr_vstore, expr_vstore_mut_box};
3131
use ast::{expr_vstore_slice, expr_vstore_box};
3232
use ast::{expr_vstore_mut_slice, expr_while, extern_fn, field, fn_decl};
33-
use ast::{expr_vstore_uniq, Onceness, Once, Many};
33+
use ast::{expr_vstore_uniq, TyClosure, TyBareFn, Onceness, Once, Many};
3434
use ast::{foreign_item, foreign_item_const, foreign_item_fn, foreign_mod};
3535
use ast::{ident, impure_fn, inherited, item, item_, item_const};
36-
use ast::{item_enum, item_fn, item_foreign_mod, item_impl};
36+
use ast::{item_const, item_enum, item_fn, item_foreign_mod, item_impl};
3737
use ast::{item_mac, item_mod, item_struct, item_trait, item_ty, lit, lit_};
3838
use ast::{lit_bool, lit_float, lit_float_unsuffixed, lit_int};
3939
use ast::{lit_int_unsuffixed, lit_nil, lit_str, lit_uint, local, m_const};

branches/dist-snap/src/test/auxiliary/mod_trait_with_static_methods_lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@
99
// except according to those terms.
1010

1111
pub use sub_foo::Foo;
12-
pub use Baz = self::Bar;
13-
14-
pub trait Bar {
15-
pub fn bar() -> Self;
16-
}
17-
18-
impl Bar for int {
19-
pub fn bar() -> int { 84 }
20-
}
2112

2213
pub mod sub_foo {
2314
pub trait Foo {
@@ -27,5 +18,4 @@ pub mod sub_foo {
2718
impl Foo for int {
2819
pub fn foo() -> int { 42 }
2920
}
30-
3121
}

branches/dist-snap/src/test/run-pass/trait_with_static_methods_cross_crate.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
extern mod mod_trait_with_static_methods_lib;
1414

1515
use mod_trait_with_static_methods_lib::Foo;
16-
use mod_trait_with_static_methods_lib::Baz;
1716

1817
pub fn main() {
1918
assert_eq!(42, Foo::foo());
20-
assert_eq!(84, Baz::bar());
2119
}

0 commit comments

Comments
 (0)