diff options
| author | bors <bors@rust-lang.org> | 2017-12-14 12:50:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-12-14 12:50:00 +0000 |
| commit | 8624ea51172c8a86d5c7c47d740be65a3a9efbc6 (patch) | |
| tree | 9cf47887652e5148f68c031c57fd7f42feff782e /src/test | |
| parent | 75a02a919c5109c55c652dd6671553df6452be04 (diff) | |
| parent | d732da813bac73d2c81caddd06df3df3d9609e3d (diff) | |
| download | rust-8624ea51172c8a86d5c7c47d740be65a3a9efbc6.tar.gz rust-8624ea51172c8a86d5c7c47d740be65a3a9efbc6.zip | |
Auto merge of #46335 - oli-obk:cleanups, r=jseyfried
Use PathBuf instead of String where applicable r? @jseyfried
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/codegen/remap_path_prefix/main.rs | 2 | ||||
| -rw-r--r-- | src/test/run-make/issue-19371/foo.rs | 10 | ||||
| -rw-r--r-- | src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/test/codegen/remap_path_prefix/main.rs b/src/test/codegen/remap_path_prefix/main.rs index c73739bb765..ea0c9ad2b83 100644 --- a/src/test/codegen/remap_path_prefix/main.rs +++ b/src/test/codegen/remap_path_prefix/main.rs @@ -32,7 +32,7 @@ fn main() { } // Here we check that local debuginfo is mapped correctly. -// CHECK: !DIFile(filename: "/the/src/remap_path_prefix/main.rs", directory: "/the/cwd") +// CHECK: !DIFile(filename: "/the/src/remap_path_prefix/main.rs", directory: "/the/cwd/") // And here that debuginfo from other crates are expanded to absolute paths. // CHECK: !DIFile(filename: "/the/aux-src/remap_path_prefix_aux.rs", directory: "") diff --git a/src/test/run-make/issue-19371/foo.rs b/src/test/run-make/issue-19371/foo.rs index 4db027aaeef..cfe8048638a 100644 --- a/src/test/run-make/issue-19371/foo.rs +++ b/src/test/run-make/issue-19371/foo.rs @@ -19,13 +19,13 @@ extern crate rustc_trans; extern crate syntax; use rustc::session::{build_session, Session}; -use rustc::session::config::{basic_options, build_configuration, Input, +use rustc::session::config::{basic_options, Input, OutputType, OutputTypes}; -use rustc_driver::driver::{compile_input, CompileController, anon_src}; +use rustc_driver::driver::{compile_input, CompileController}; use rustc_metadata::cstore::CStore; use rustc_errors::registry::Registry; +use syntax::codemap::FileName; -use std::collections::HashSet; use std::path::PathBuf; use std::rc::Rc; @@ -56,7 +56,7 @@ fn basic_sess(sysroot: PathBuf) -> (Session, Rc<CStore>) { opts.output_types = OutputTypes::new(&[(OutputType::Exe, None)]); opts.maybe_sysroot = Some(sysroot); if let Ok(linker) = std::env::var("RUSTC_LINKER") { - opts.cg.linker = Some(linker); + opts.cg.linker = Some(linker.into()); } let descriptions = Registry::new(&rustc::DIAGNOSTICS); @@ -70,6 +70,6 @@ fn basic_sess(sysroot: PathBuf) -> (Session, Rc<CStore>) { fn compile(code: String, output: PathBuf, sysroot: PathBuf) { let (sess, cstore) = basic_sess(sysroot); let control = CompileController::basic(); - let input = Input::Str { name: anon_src(), input: code }; + let input = Input::Str { name: FileName::Anon, input: code }; let _ = compile_input(&sess, &cstore, &input, &None, &Some(output), None, &control); } diff --git a/src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs b/src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs index fc031f4a310..9f9ef477224 100644 --- a/src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs +++ b/src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs @@ -17,7 +17,7 @@ extern crate syntax; use syntax::ast::*; use syntax::attr::*; use syntax::ast; -use syntax::codemap::FilePathMapping; +use syntax::codemap::{FilePathMapping, FileName}; use syntax::parse; use syntax::parse::{ParseSess, PResult}; use syntax::parse::new_parser_from_source_str; @@ -32,7 +32,7 @@ use std::fmt; // Copied out of syntax::util::parser_testing pub fn string_to_parser<'a>(ps: &'a ParseSess, source_str: String) -> Parser<'a> { - new_parser_from_source_str(ps, "bogofile".to_string(), source_str) + new_parser_from_source_str(ps, FileName::Custom("bogofile".to_owned()), source_str) } fn with_error_checking_parse<'a, T, F>(s: String, ps: &'a ParseSess, f: F) -> PResult<'a, T> where diff --git a/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs b/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs index 456088b2c52..e84a982f7b3 100644 --- a/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs +++ b/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs @@ -33,7 +33,7 @@ extern crate syntax; use syntax::ast::*; -use syntax::codemap::{Spanned, DUMMY_SP}; +use syntax::codemap::{Spanned, DUMMY_SP, FileName}; use syntax::codemap::FilePathMapping; use syntax::fold::{self, Folder}; use syntax::parse::{self, ParseSess}; @@ -44,7 +44,7 @@ use syntax::util::ThinVec; fn parse_expr(ps: &ParseSess, src: &str) -> P<Expr> { let mut p = parse::new_parser_from_source_str(ps, - "<expr>".to_owned(), + FileName::Custom("expr".to_owned()), src.to_owned()); p.parse_expr().unwrap() } |
