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/libsyntax/util/parser_testing.rs | |
| 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/libsyntax/util/parser_testing.rs')
| -rw-r--r-- | src/libsyntax/util/parser_testing.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index d993ba14a4a..42cd7c8faa5 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -16,16 +16,18 @@ use parse::parser::Parser; use ptr::P; use tokenstream::TokenStream; use std::iter::Peekable; +use std::path::PathBuf; /// Map a string to tts, using a made-up filename: pub fn string_to_stream(source_str: String) -> TokenStream { let ps = ParseSess::new(FilePathMapping::empty()); - filemap_to_stream(&ps, ps.codemap().new_filemap("bogofile".to_string(), source_str), None) + filemap_to_stream(&ps, ps.codemap() + .new_filemap(PathBuf::from("bogofile").into(), source_str), None) } /// Map string to parser (via tts) 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, PathBuf::from("bogofile").into(), source_str) } fn with_error_checking_parse<'a, T, F>(s: String, ps: &'a ParseSess, f: F) -> T where |
