Skip to content

Commit e8782ee

Browse files
committed
fix tests, remove some warnings
1 parent 2fa83c0 commit e8782ee

File tree

22 files changed

+18
-44
lines changed

22 files changed

+18
-44
lines changed

doc/rust.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -802,15 +802,15 @@ Use declarations support a number of convenient shortcuts:
802802
An example of `use` declarations:
803803

804804
~~~~
805-
use std::float::{sin, pow};
806-
use std::option::Some;
805+
use std::float::sin;
806+
use std::option::{Some, None};
807807
808808
fn main() {
809-
// Equivalent to 'info!(std::float::pow(std::float::sin(1.0), 2.0));'
810-
info!(pow(sin(1.0), 2.0));
809+
// Equivalent to 'info!(std::float::sin(1.0));'
810+
info!(sin(1.0));
811811
812-
// Equivalent to 'info!(std::option::Some(1.0));'
813-
info!(Some(1.0));
812+
// Equivalent to 'info!(~[std::option::Some(1.0), std::option::None]);'
813+
info!(~[Some(1.0), None]);
814814
}
815815
~~~~
816816

src/compiletest/errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use core::prelude::*;
1212

1313
use core::io;
14-
use core::str;
1514

1615
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
1716

src/compiletest/header.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use common;
1616
use core::iterator::IteratorUtil;
1717
use core::io;
1818
use core::os;
19-
use core::str;
2019

2120
pub struct TestProps {
2221
// Lines that should be expected, in order, on standard out

src/libextra/net_url.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use core::cmp::Eq;
1919
use core::io::{Reader, ReaderUtil};
2020
use core::io;
2121
use core::hashmap::HashMap;
22-
use core::str;
2322
use core::to_bytes;
2423
use core::uint;
2524

@@ -394,7 +393,7 @@ enum Input {
394393
// returns userinfo, host, port, and unparsed part, or an error
395394
fn get_authority(rawurl: &str) ->
396395
Result<(Option<UserInfo>, ~str, Option<~str>, ~str), ~str> {
397-
if !raw_url.starts_with("//") {
396+
if !rawurl.starts_with("//") {
398397
// there is no authority.
399398
return Ok((None, ~"", None, rawurl.to_str()));
400399
}

src/libextra/rope.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ use core::prelude::*;
4040
use core::iterator::IteratorUtil;
4141
use core::uint;
4242
use core::vec;
43+
use core::str;
4344

4445
/// The type of ropes.
4546
pub type Rope = node::Root;
@@ -1187,8 +1188,6 @@ pub mod node {
11871188
pub mod char_iterator {
11881189
use core::prelude::*;
11891190

1190-
use core::str;
1191-
11921191
use rope::node::{Leaf, Node};
11931192
use rope::node::leaf_iterator;
11941193

src/libextra/semver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use core::cmp;
2020
use core::io::{ReaderUtil};
2121
use core::io;
2222
use core::option::{Option, Some, None};
23-
use core::str;
2423
use core::to_str::ToStr;
2524
use core::uint;
2625

src/libfuzzer/fuzzer.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use std::result;
3737
use std::run;
3838
use std::str;
3939
use std::uint;
40-
use std::vec;
4140

4241
use syntax::diagnostic;
4342
use syntax::parse::token::ident_interner;

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ pub fn trans_enum_variant(ccx: @CrateContext,
19951995

19961996
debug!("trans_enum_variant: name=%s tps=%s repr=%? enum_ty=%s",
19971997
unsafe { str::raw::from_c_str(llvm::LLVMGetValueName(llfndecl)) },
1998-
~"[" + ty_param_substs.map(|&t| ty_to_str(ccx.tcx.connect(t)), ", ") + "]",
1998+
~"[" + ty_param_substs.map(|&t| ty_to_str(ccx.tcx, t)).connect(", ") + "]",
19991999
repr, ty_to_str(ccx.tcx, enum_ty));
20002000
20012001
adt::trans_start_init(bcx, repr, fcx.llretptr.get(), disr);

src/librustc/middle/trans/build.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ pub fn Invoke(cx: block,
192192
terminate(cx, "Invoke");
193193
debug!("Invoke(%s with arguments (%s))",
194194
val_str(cx.ccx().tn, Fn),
195-
vec::map(Args.connect(|a| val_str(cx.ccx().tn,
196-
*a).to_owned()),
197-
", "));
195+
Args.map(|a| val_str(cx.ccx().tn, *a).to_owned()).connect(", "));
198196
unsafe {
199197
count_insn(cx, "invoke");
200198
llvm::LLVMBuildInvoke(B(cx),

src/librustc/middle/typeck/check/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ use core::iterator::IteratorUtil;
115115
use core::cast::transmute;
116116
use core::hashmap::HashMap;
117117
use core::result;
118-
use core::str;
119118
use core::util::replace;
120119
use core::vec;
121120
use extra::list::Nil;

0 commit comments

Comments
 (0)