Skip to content

Commit b07dbe1

Browse files
committed
Add doc comment
1 parent e186d3f commit b07dbe1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libsyntax/parse/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,16 @@ pub fn stream_to_parser(sess: &ParseSess, stream: TokenStream) -> Parser<'_> {
330330
}
331331

332332
/// Given stream, the `ParseSess` and the base directory, produces a parser.
333+
///
334+
/// Use this function when you are creating a parser from the token stream
335+
/// and also care about the current working directory of the parser (e.g.,
336+
/// you are trying to resolve modules defined inside a macro invocation).
337+
///
338+
/// # Note
339+
///
340+
/// The main usage of this function is outside of rustc, for those who uses
341+
/// libsyntax as a library. Please do not remove this function while refactoring
342+
/// just because it is not used in rustc codebase!
333343
pub fn stream_to_parser_with_base_dir<'a>(sess: &'a ParseSess,
334344
stream: TokenStream,
335345
base_dir: Directory<'a>) -> Parser<'a> {

0 commit comments

Comments
 (0)