Skip to content

Commit 139346a

Browse files
committed
tests: fix fallout of merging ast::ViewItem into ast::Item.
1 parent 838b2ea commit 139346a

File tree

7 files changed

+14
-47
lines changed

7 files changed

+14
-47
lines changed

src/librustc_driver/test.rs

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ impl<'a, 'tcx> Env<'a, 'tcx> {
200200
}
201201

202202
return match it.node {
203+
ast::ItemUse(..) | ast::ItemExternCrate(..) |
203204
ast::ItemConst(..) | ast::ItemStatic(..) | ast::ItemFn(..) |
204205
ast::ItemForeignMod(..) | ast::ItemTy(..) => {
205206
None

src/libsyntax/parse/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1109,25 +1109,25 @@ mod test {
11091109

11101110
#[test] fn parse_use() {
11111111
let use_s = "use foo::bar::baz;";
1112-
let vitem = string_to_item(use_s.to_string());
1113-
let vitem_s = item_to_string(&vitem);
1112+
let vitem = string_to_item(use_s.to_string()).unwrap();
1113+
let vitem_s = item_to_string(&*vitem);
11141114
assert_eq!(&vitem_s[], use_s);
11151115

11161116
let use_s = "use foo::bar as baz;";
1117-
let vitem = string_to_item(use_s.to_string());
1118-
let vitem_s = item_to_string(&vitem);
1117+
let vitem = string_to_item(use_s.to_string()).unwrap();
1118+
let vitem_s = item_to_string(&*vitem);
11191119
assert_eq!(&vitem_s[], use_s);
11201120
}
11211121

11221122
#[test] fn parse_extern_crate() {
11231123
let ex_s = "extern crate foo;";
1124-
let vitem = string_to_item(ex_s.to_string());
1125-
let vitem_s = item_to_string(&vitem);
1124+
let vitem = string_to_item(ex_s.to_string()).unwrap();
1125+
let vitem_s = item_to_string(&*vitem);
11261126
assert_eq!(&vitem_s[], ex_s);
11271127

11281128
let ex_s = "extern crate \"foo\" as bar;";
1129-
let vitem = string_to_item(ex_s.to_string());
1130-
let vitem_s = item_to_string(&vitem);
1129+
let vitem = string_to_item(ex_s.to_string()).unwrap();
1130+
let vitem_s = item_to_string(&*vitem);
11311131
assert_eq!(&vitem_s[], ex_s);
11321132
}
11331133

src/test/compile-fail-fulldeps/gated-plugin.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
// aux-build:macro_crate_test.rs
1212
// ignore-stage1
1313

14-
#[plugin] #[no_link]
14+
#[plugin] #[no_link] extern crate macro_crate_test;
1515
//~^ ERROR compiler plugins are experimental and possibly buggy
16-
extern crate macro_crate_test;
1716

1817
fn main() {}

src/test/compile-fail/issue-9957.rs

-15
This file was deleted.

src/test/compile-fail/unnecessary-private.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
fn main() {
12+
pub use std::uint; //~ ERROR: visibility has no effect
1213
pub struct A; //~ ERROR: visibility has no effect
1314
pub enum B {} //~ ERROR: visibility has no effect
1415
pub trait C { //~ ERROR: visibility has no effect

src/test/compile-fail/view-items-at-top.rs

-19
This file was deleted.

src/test/pretty/issue-4264.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![no_std]
2-
#[macro_use]
3-
extern crate "std" as std;
42
#[prelude_import]
53
use std::prelude::v1::*;
4+
#[macro_use]
5+
extern crate "std" as std;
66
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
77
// file at the top-level directory of this distribution and at
88
// http://rust-lang.org/COPYRIGHT.

0 commit comments

Comments
 (0)