about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-03-09 17:18:28 +0100
committerGitHub <noreply@github.com>2019-03-09 17:18:28 +0100
commit4eb762a0eada2d2789f9db6eabfe538e9b8ee41d (patch)
tree085b13b699ff67ecb9fb36598d652bb1f3f770ff /src/libsyntax
parent02c9928f446cc96aed19d8eb4df0aa3602877ffa (diff)
parent2309625941ac548c407def97eb87d03b237737cf (diff)
downloadrust-4eb762a0eada2d2789f9db6eabfe538e9b8ee41d.tar.gz
rust-4eb762a0eada2d2789f9db6eabfe538e9b8ee41d.zip
Rollup merge of #59045 - topecongiro:expose-new_sub_parser_from_file, r=Centril
Expose new_sub_parser_from_file

This function is useful when external tools like rustfmt want to parse
internal files without parsing a whole crate.

cc https://github.com/rust-lang/rustfmt/issues/3427.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/parse/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index 98b5fe563b8..371e8fe5cf6 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -185,7 +185,7 @@ pub fn maybe_new_parser_from_file<'a>(sess: &'a ParseSess, path: &Path)
 /// Given a session, a crate config, a path, and a span, add
 /// the file at the given path to the source_map, and return a parser.
 /// On an error, use the given span as the source of the problem.
-crate fn new_sub_parser_from_file<'a>(sess: &'a ParseSess,
+pub fn new_sub_parser_from_file<'a>(sess: &'a ParseSess,
                                     path: &Path,
                                     directory_ownership: DirectoryOwnership,
                                     module_name: Option<String>,