Skip to content

Commit 9635b30

Browse files
committed
cleanup warnings from librustc
1 parent a4df35f commit 9635b30

File tree

7 files changed

+15
-18
lines changed

7 files changed

+15
-18
lines changed

src/librustc/back/rpath.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ mod test {
211211

212212
#[test]
213213
fn test_rpaths_to_flags() {
214-
let flags = rpaths_to_flags(~[Path("path1"),
215-
Path("path2")]);
214+
let flags = rpaths_to_flags([Path("path1"),
215+
Path("path2")]);
216216
assert_eq!(flags, ~[~"-Wl,-rpath,path1", ~"-Wl,-rpath,path2"]);
217217
}
218218
@@ -243,10 +243,10 @@ mod test {
243243
244244
#[test]
245245
fn test_minimize2() {
246-
let res = minimize_rpaths(~[Path("1a"), Path("2"), Path("2"),
247-
Path("1a"), Path("4a"),Path("1a"),
248-
Path("2"), Path("3"), Path("4a"),
249-
Path("3")]);
246+
let res = minimize_rpaths([Path("1a"), Path("2"), Path("2"),
247+
Path("1a"), Path("4a"),Path("1a"),
248+
Path("2"), Path("3"), Path("4a"),
249+
Path("3")]);
250250
assert_eq!(res, ~[Path("1a"), Path("2"), Path("4a"), Path("3")]);
251251
}
252252

src/librustc/driver/driver.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use core::io;
3030
use core::os;
3131
use core::str;
3232
use core::vec;
33-
use extra::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts};
33+
use extra::getopts::groups::{optopt, optmulti, optflag, optflagopt};
3434
use extra::getopts::{opt_present};
3535
use extra::getopts;
3636
use syntax::ast;
@@ -942,15 +942,15 @@ mod test {
942942
@~"rustc", matches, diagnostic::emit);
943943
let sess = build_session(sessopts, diagnostic::emit);
944944
let cfg = build_configuration(sess, @~"whatever", &str_input(~""));
945-
assert!((attr::contains_name(cfg, ~"test")));
945+
assert!((attr::contains_name(cfg, "test")));
946946
}
947947

948948
// When the user supplies --test and --cfg test, don't implicitly add
949949
// another --cfg test
950950
#[test]
951951
fn test_switch_implies_cfg_test_unless_cfg_test() {
952952
let matches =
953-
&match getopts(~[~"--test", ~"--cfg=test"], optgroups()) {
953+
&match getopts([~"--test", ~"--cfg=test"], optgroups()) {
954954
Ok(copy m) => m,
955955
Err(copy f) => {
956956
fail!("test_switch_implies_cfg_test_unless_cfg_test: %s", getopts::fail_str(f));
@@ -960,7 +960,7 @@ mod test {
960960
@~"rustc", matches, diagnostic::emit);
961961
let sess = build_session(sessopts, diagnostic::emit);
962962
let cfg = build_configuration(sess, @~"whatever", &str_input(~""));
963-
let test_items = attr::find_meta_items_by_name(cfg, ~"test");
963+
let test_items = attr::find_meta_items_by_name(cfg, "test");
964964
assert_eq!(test_items.len(), 1u);
965965
}
966966
}

src/librustc/middle/lint.rs

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

1111
use core::prelude::*;
1212

13-
use driver::session::Session;
1413
use driver::session;
1514
use middle::ty;
1615
use middle::pat_util;

src/librustc/middle/resolve.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ pub impl NameBindings {
535535
parent_link: ParentLink,
536536
def_id: Option<def_id>,
537537
kind: ModuleKind,
538-
sp: span) {
538+
_sp: span) {
539539
match self.type_def {
540540
None => {
541541
let module = @mut Module(parent_link, def_id, kind);
@@ -2586,8 +2586,8 @@ pub impl Resolver {
25862586
(ImportSearch, ImplModuleKind) => {
25872587
self.session.span_err(
25882588
span,
2589-
~"cannot import from a trait \
2590-
or type implementation");
2589+
"cannot import from a trait \
2590+
or type implementation");
25912591
return Failed;
25922592
}
25932593
(_, _) => search_module = module_def,

src/librustc/middle/trans/meth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ pub fn trans_trait_cast(bcx: block,
873873
val: @ast::expr,
874874
id: ast::node_id,
875875
dest: expr::Dest,
876-
store: ty::TraitStore)
876+
_store: ty::TraitStore)
877877
-> block {
878878
let mut bcx = bcx;
879879
let _icx = bcx.insn_ctxt("impl::trans_cast");

src/librustc/middle/trans/reflect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub impl Reflector {
145145
}
146146

147147
fn leaf(&mut self, name: ~str) {
148-
self.visit(name, ~[]);
148+
self.visit(name, []);
149149
}
150150

151151
// Entrypoint

src/librustc/util/enum_set.rs

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

1111
use core::prelude::*;
1212

13-
use core;
14-
1513
#[deriving(Eq, IterBytes)]
1614
pub struct EnumSet<E> {
1715
// We must maintain the invariant that no bits are set

0 commit comments

Comments
 (0)