diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-07-31 12:49:01 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-07-31 14:47:08 +1000 |
| commit | 2e6ce68fba372f2a334abfe3f0118782776b8b74 (patch) | |
| tree | 9c57a7c283bed54ed15647846fa9c446e3514f36 /compiler/rustc_parse/src | |
| parent | d72fc5ce445c9a84dc289334b8aa7b34a144619b (diff) | |
| download | rust-2e6ce68fba372f2a334abfe3f0118782776b8b74.tar.gz rust-2e6ce68fba372f2a334abfe3f0118782776b8b74.zip | |
Remove `desugar_doc_comments` arg from `Parser::new()`.
It's only true at one call site; do the desugaring there instead.
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/lib.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 7 |
2 files changed, 3 insertions, 8 deletions
diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index 25de7808532..52990a3bd0d 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -205,7 +205,7 @@ pub fn stream_to_parser<'a>( stream: TokenStream, subparser_name: Option<&'static str>, ) -> Parser<'a> { - Parser::new(sess, stream, false, subparser_name) + Parser::new(sess, stream, subparser_name) } /// Runs the given subparser `f` on the tokens of the given `attr`'s item. @@ -215,7 +215,7 @@ pub fn parse_in<'a, T>( name: &'static str, mut f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>, ) -> PResult<'a, T> { - let mut parser = Parser::new(sess, tts, false, Some(name)); + let mut parser = Parser::new(sess, tts, Some(name)); let result = f(&mut parser)?; if parser.token != token::Eof { parser.unexpected()?; diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 7d39bf8edf3..d689b61f63f 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -388,14 +388,9 @@ pub(super) fn token_descr(token: &Token) -> String { impl<'a> Parser<'a> { pub fn new( sess: &'a ParseSess, - mut stream: TokenStream, - desugar_doc_comments: bool, + stream: TokenStream, subparser_name: Option<&'static str>, ) -> Self { - if desugar_doc_comments { - stream.desugar_doc_comments(); - } - let mut parser = Parser { sess, token: Token::dummy(), |
