Skip to content

Commit 84ce55e

Browse files
committed
librustc: Fix some unresolved imports in the test runner. rs=bustage
1 parent c880d0a commit 84ce55e

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

src/librustc/back/rpath.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ fn get_rpaths_relative_to_output(os: session::os,
114114

115115
fn get_rpath_relative_to_output(os: session::os,
116116
output: &Path,
117-
lib: &Path) -> Path {
117+
lib: &Path)
118+
-> Path {
119+
use core::os;
120+
118121
assert not_win32(os);
119122

120123
// Mac doesn't appear to support $ORIGIN
@@ -197,6 +200,12 @@ fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] {
197200
#[cfg(unix)]
198201
mod test {
199202
#[legacy_exports];
203+
204+
use driver::session;
205+
206+
use core::os;
207+
use core::str;
208+
200209
#[test]
201210
fn test_rpaths_to_flags() {
202211
let flags = rpaths_to_flags(~[Path("path1"),

src/librustc/driver/driver.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,11 @@ fn list_metadata(sess: Session, path: &Path, out: io::Writer) {
828828
mod test {
829829
#[legacy_exports];
830830

831+
use core::vec;
832+
use std::getopts;
833+
use syntax::attr;
834+
use syntax::diagnostic;
835+
831836
// When the user supplies --test we should implicitly supply --cfg test
832837
#[test]
833838
fn test_switch_implies_cfg_test() {

src/librustc/driver/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ fn sess_os_to_meta_os(os: os) -> metadata::loader::os {
332332
#[cfg(test)]
333333
mod test {
334334
#[legacy_exports];
335+
use syntax::ast;
335336
use syntax::ast_util;
336337

337338
fn make_crate_type_attr(t: ~str) -> ast::attribute {

src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fn nospan<T: Copy>(t: T) -> ast::spanned<T> {
238238
}
239239

240240
fn path_node(ids: ~[ast::ident]) -> @ast::path {
241-
@{span: dummy_sp(), global: false, idents: ids, rp: None, types: ~[]}
241+
@{span: dummy_sp(), global: true, idents: ids, rp: None, types: ~[]}
242242
}
243243

244244
fn mk_tests(cx: test_ctxt) -> @ast::item {

src/librustc/middle/astencode.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ use middle::{ty, typeck};
2323
use middle;
2424
use util::ppaux::ty_to_str;
2525

26-
use core::{dvec, option, vec};
26+
use core::{dvec, io, option, vec};
2727
use std::ebml::reader::get_doc;
2828
use std::ebml::reader;
2929
use std::ebml::writer::Encoder;
3030
use std::ebml;
3131
use std::map::HashMap;
32+
use std::prettyprint;
3233
use std::serialize;
3334
use std::serialize::{Encodable, EncoderHelpers, DecoderHelpers};
3435
use std::serialize::Decodable;
@@ -1071,10 +1072,10 @@ fn roundtrip(in_item: Option<@ast::item>) {
10711072
let out_item = decode_item_ast(ebml_doc);
10721073

10731074
let exp_str = do io::with_str_writer |w| {
1074-
in_item.encode(&std::prettyprint::Encoder(w))
1075+
in_item.encode(&prettyprint::Serializer(w))
10751076
};
10761077
let out_str = do io::with_str_writer |w| {
1077-
out_item.encode(&std::prettyprint::Encoder(w))
1078+
out_item.encode(&prettyprint::Serializer(w))
10781079
};
10791080

10801081
debug!("expected string: %s", exp_str);

0 commit comments

Comments
 (0)