diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index f68c76f4c442..cd28a27f9886 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -200,6 +200,7 @@ impl<'a, 'tcx> Env<'a, 'tcx> { } return match it.node { + ast::ItemUse(..) | ast::ItemExternCrate(..) | ast::ItemConst(..) | ast::ItemStatic(..) | ast::ItemFn(..) | ast::ItemForeignMod(..) | ast::ItemTy(..) => { None diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 49dca01ef501..8ac94a38273b 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -1109,25 +1109,25 @@ mod test { #[test] fn parse_use() { let use_s = "use foo::bar::baz;"; - let vitem = string_to_item(use_s.to_string()); - let vitem_s = item_to_string(&vitem); + let vitem = string_to_item(use_s.to_string()).unwrap(); + let vitem_s = item_to_string(&*vitem); assert_eq!(&vitem_s[], use_s); let use_s = "use foo::bar as baz;"; - let vitem = string_to_item(use_s.to_string()); - let vitem_s = item_to_string(&vitem); + let vitem = string_to_item(use_s.to_string()).unwrap(); + let vitem_s = item_to_string(&*vitem); assert_eq!(&vitem_s[], use_s); } #[test] fn parse_extern_crate() { let ex_s = "extern crate foo;"; - let vitem = string_to_item(ex_s.to_string()); - let vitem_s = item_to_string(&vitem); + let vitem = string_to_item(ex_s.to_string()).unwrap(); + let vitem_s = item_to_string(&*vitem); assert_eq!(&vitem_s[], ex_s); let ex_s = "extern crate \"foo\" as bar;"; - let vitem = string_to_item(ex_s.to_string()); - let vitem_s = item_to_string(&vitem); + let vitem = string_to_item(ex_s.to_string()).unwrap(); + let vitem_s = item_to_string(&*vitem); assert_eq!(&vitem_s[], ex_s); } diff --git a/src/test/compile-fail-fulldeps/gated-plugin.rs b/src/test/compile-fail-fulldeps/gated-plugin.rs index 89090d5f38ab..be9e57e2d195 100644 --- a/src/test/compile-fail-fulldeps/gated-plugin.rs +++ b/src/test/compile-fail-fulldeps/gated-plugin.rs @@ -11,8 +11,7 @@ // aux-build:macro_crate_test.rs // ignore-stage1 -#[plugin] #[no_link] +#[plugin] #[no_link] extern crate macro_crate_test; //~^ ERROR compiler plugins are experimental and possibly buggy -extern crate macro_crate_test; fn main() {} diff --git a/src/test/compile-fail/issue-9957.rs b/src/test/compile-fail/issue-9957.rs deleted file mode 100644 index b1204e828900..000000000000 --- a/src/test/compile-fail/issue-9957.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub extern crate core; //~ ERROR: `pub` visibility is not allowed - -fn main() { - pub use std::usize; //~ ERROR: imports in functions are never reachable -} diff --git a/src/test/compile-fail/unnecessary-private.rs b/src/test/compile-fail/unnecessary-private.rs index 6e6ffd23c4a8..e3707292f249 100644 --- a/src/test/compile-fail/unnecessary-private.rs +++ b/src/test/compile-fail/unnecessary-private.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -9,6 +9,7 @@ // except according to those terms. fn main() { + pub use std::uint; //~ ERROR: visibility has no effect pub struct A; //~ ERROR: visibility has no effect pub enum B {} //~ ERROR: visibility has no effect pub trait C { //~ ERROR: visibility has no effect diff --git a/src/test/compile-fail/view-items-at-top.rs b/src/test/compile-fail/view-items-at-top.rs deleted file mode 100644 index 7b78a8d932b3..000000000000 --- a/src/test/compile-fail/view-items-at-top.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -extern crate test; - -fn f() { -} - -use test::net; //~ ERROR `use` and `extern crate` declarations must precede items - -fn main() { -} diff --git a/src/test/pretty/issue-4264.pp b/src/test/pretty/issue-4264.pp index dac6e628d10d..c18d076c0d31 100644 --- a/src/test/pretty/issue-4264.pp +++ b/src/test/pretty/issue-4264.pp @@ -1,8 +1,8 @@ #![no_std] -#[macro_use] -extern crate "std" as std; #[prelude_import] use std::prelude::v1::*; +#[macro_use] +extern crate "std" as std; // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT.