Skip to content

Commit b90992d

Browse files
committed
---
yaml --- r: 65097 b: refs/heads/master c: dc57d15 h: refs/heads/master i: 65095: e7f2631 v: v3
1 parent 9bf921f commit b90992d

File tree

12 files changed

+18
-266
lines changed

12 files changed

+18
-266
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: cab9249c62d5f33b3ae625970c05231341d2f95e
2+
refs/heads/master: dc57d15b69601e8d88e7ee71b578a1624e28f89e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libcore/io.rs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,16 +1010,6 @@ pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
10101010
// top-level functions that take a reader, or a set of default methods on
10111011
// reader (which can then be called reader)
10121012

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-
*/
10231013
pub fn stdin() -> @Reader {
10241014
unsafe {
10251015
@rustrt::rust_get_stdin() as @Reader
@@ -1571,57 +1561,13 @@ pub fn buffered_file_writer(path: &Path) -> Result<@Writer, ~str> {
15711561
// FIXME (#2004) it would be great if this could be a const
15721562
// FIXME (#2004) why are these different from the way stdin() is
15731563
// 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-
*/
15851564
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-
*/
15961565
pub fn stderr() -> @Writer { fd_writer(libc::STDERR_FILENO as c_int, false) }
15971566
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-
*/
16101567
pub fn print(s: &str) {
16111568
stdout().write_str(s);
16121569
}
16131570
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-
*/
16251571
pub fn println(s: &str) {
16261572
stdout().write_line(s);
16271573
}

trunk/src/libcore/rt/stack.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ pub impl StackSegment {
3939

4040
/// Point to the low end of the allocated stack
4141
fn start(&self) -> *uint {
42-
unsafe {
43-
vec::raw::to_ptr(self.buf) as *uint
44-
}
42+
vec::raw::to_ptr(self.buf) as *uint
4543
}
4644

4745
/// Point one word beyond the high end of the allocated stack

trunk/src/libcore/rt/uv/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ use vec;
4444
use ptr;
4545
use cast;
4646
use str;
47-
use option::*;
48-
use str::raw::from_c_str;
49-
use to_str::ToStr;
5047
use libc::{c_void, c_int, size_t, malloc, free};
5148
use cast::transmute;
5249
use ptr::null;

trunk/src/libcore/rt/uv/uvio.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use option::*;
1212
use result::*;
1313
use ops::Drop;
14-
use old_iter::CopyableIter;
1514
use cell::{Cell, empty_cell};
1615
use cast::transmute;
1716
use clone::Clone;

trunk/src/libcore/unstable/lang.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use libc::{c_char, c_uchar, c_void, size_t, uintptr_t, c_int, STDERR_FILENO};
1616
use managed::raw::BoxRepr;
1717
use str;
1818
use sys;
19-
use cast::transmute;
2019
use rt::{context, OldTaskContext};
2120
use rt::local_services::borrow_local_services;
2221
use option::{Option, Some, None};

trunk/src/librustc/lib/llvm.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use core::hashmap::HashMap;
12-
use core::libc::{c_uint, c_ushort};
12+
use core::libc::c_uint;
1313

1414
pub type Opcode = u32;
1515
pub type Bool = c_uint;
@@ -221,7 +221,7 @@ pub mod llvm {
221221
use super::{SectionIteratorRef, TargetDataRef, TypeKind, TypeRef, UseRef};
222222
use super::{ValueRef};
223223

224-
use core::libc::{c_char, c_int, c_longlong, c_ushort, c_uint, c_ulonglong};
224+
use core::libc::{c_char, c_int, c_longlong, c_uint, c_ulonglong};
225225

226226
#[link_args = "-Lrustllvm -lrustllvm"]
227227
#[link_name = "rustllvm"]
@@ -451,10 +451,6 @@ pub mod llvm {
451451
/* all zeroes */
452452
#[fast_ffi]
453453
pub unsafe fn LLVMConstAllOnes(Ty: TypeRef) -> ValueRef;
454-
#[fast_ffi]
455-
pub unsafe fn LLVMConstICmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef) -> ValueRef;
456-
#[fast_ffi]
457-
pub unsafe fn LLVMConstFCmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef) -> ValueRef;
458454
/* only for int/vector */
459455
#[fast_ffi]
460456
pub unsafe fn LLVMGetUndef(Ty: TypeRef) -> ValueRef;
@@ -1918,16 +1914,6 @@ pub fn SetLinkage(Global: ValueRef, Link: Linkage) {
19181914
}
19191915
}
19201916

1921-
pub fn ConstICmp(Pred: IntPredicate, V1: ValueRef, V2: ValueRef) -> ValueRef {
1922-
unsafe {
1923-
llvm::LLVMConstICmp(Pred as c_ushort, V1, V2)
1924-
}
1925-
}
1926-
pub fn ConstFCmp(Pred: RealPredicate, V1: ValueRef, V2: ValueRef) -> ValueRef {
1927-
unsafe {
1928-
llvm::LLVMConstFCmp(Pred as c_ushort, V1, V2)
1929-
}
1930-
}
19311917
/* Memory-managed object interface to type handles. */
19321918

19331919
pub struct TypeNames {

trunk/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,

trunk/src/librustc/middle/trans/consts.rs

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
// except according to those terms.
1010

1111
use back::abi;
12-
use lib::llvm::{llvm, ConstFCmp, ConstICmp, SetLinkage, PrivateLinkage, ValueRef, TypeRef, Bool,
13-
True, False};
14-
use lib::llvm::{IntEQ, IntNE, IntUGT, IntUGE, IntULT, IntULE, IntSGT, IntSGE, IntSLT, IntSLE,
15-
RealOEQ, RealOGT, RealOGE, RealOLT, RealOLE, RealONE};
16-
12+
use lib::llvm::{llvm, SetLinkage, PrivateLinkage,
13+
ValueRef, TypeRef, Bool, True, False};
1714
use metadata::csearch;
1815
use middle::const_eval;
1916
use middle::trans::adt;
@@ -283,8 +280,8 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
283280
else if signed { llvm::LLVMConstSRem(te1, te2) }
284281
else { llvm::LLVMConstURem(te1, te2) }
285282
}
286-
ast::and => llvm::LLVMConstAnd(te1, te2),
287-
ast::or => llvm::LLVMConstOr(te1, te2),
283+
ast::and |
284+
ast::or => cx.sess.span_unimpl(e.span, "binop logic"),
288285
ast::bitxor => llvm::LLVMConstXor(te1, te2),
289286
ast::bitand => llvm::LLVMConstAnd(te1, te2),
290287
ast::bitor => llvm::LLVMConstOr(te1, te2),
@@ -293,44 +290,14 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
293290
if signed { llvm::LLVMConstAShr(te1, te2) }
294291
else { llvm::LLVMConstLShr(te1, te2) }
295292
}
296-
ast::eq => {
297-
if is_float { ConstFCmp(RealOEQ, te1, te2) }
298-
else { ConstICmp(IntEQ, te1, te2) }
299-
},
300-
ast::lt => {
301-
if is_float { ConstFCmp(RealOLT, te1, te2) }
302-
else {
303-
if signed { ConstICmp(IntSLT, te1, te2) }
304-
else { ConstICmp(IntULT, te1, te2) }
305-
}
306-
},
307-
ast::le => {
308-
if is_float { ConstFCmp(RealOLE, te1, te2) }
309-
else {
310-
if signed { ConstICmp(IntSLE, te1, te2) }
311-
else { ConstICmp(IntULE, te1, te2) }
312-
}
313-
},
314-
ast::ne => {
315-
if is_float { ConstFCmp(RealONE, te1, te2) }
316-
else { ConstICmp(IntNE, te1, te2) }
317-
},
318-
ast::ge => {
319-
if is_float { ConstFCmp(RealOGE, te1, te2) }
320-
else {
321-
if signed { ConstICmp(IntSGE, te1, te2) }
322-
else { ConstICmp(IntUGE, te1, te2) }
323-
}
324-
},
325-
ast::gt => {
326-
if is_float { ConstFCmp(RealOGT, te1, te2) }
327-
else {
328-
if signed { ConstICmp(IntSGT, te1, te2) }
329-
else { ConstICmp(IntUGT, te1, te2) }
330-
}
331-
},
332-
};
333-
},
293+
ast::eq |
294+
ast::lt |
295+
ast::le |
296+
ast::ne |
297+
ast::ge |
298+
ast::gt => cx.sess.span_unimpl(e.span, "binop comparator")
299+
}
300+
}
334301
ast::expr_unary(u, e) => {
335302
let te = const_expr(cx, e);
336303
let ty = ty::expr_ty(cx.tcx, e);

trunk/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
}

0 commit comments

Comments
 (0)