diff options
| author | bors <bors@rust-lang.org> | 2023-02-03 17:53:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-03 17:53:49 +0000 |
| commit | 658fad6c5506f41c35b64fb1a22ceb0992697ff3 (patch) | |
| tree | d9beffb3e496848ea5acbe6d9caf2d102f473eab /src | |
| parent | 9545094994f1ab45cab5799d5b45980871a9e97b (diff) | |
| parent | c9270272df5bd7254b6ce1c7b69d41c75e443406 (diff) | |
Auto merge of #107642 - Dylan-DPC:rollup-edcqhm5, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #107082 (Autotrait bounds on dyn-safe trait methods) - #107427 (Add candidates for DiscriminantKind builtin) - #107539 (Emit warnings on unused parens in index expressions) - #107544 (Improve `TokenCursor`.) - #107585 (Don't cause a cycle when formatting query description that references a FnDef) - #107633 (Fix suggestion for coercing Option<&String> to Option<&str>) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/rustfmt/src/macros.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/rustfmt/src/macros.rs b/src/tools/rustfmt/src/macros.rs index d58f7547fef..7978d8cba95 100644 --- a/src/tools/rustfmt/src/macros.rs +++ b/src/tools/rustfmt/src/macros.rs @@ -13,7 +13,7 @@ use std::collections::HashMap; use std::panic::{catch_unwind, AssertUnwindSafe}; use rustc_ast::token::{BinOpToken, Delimiter, Token, TokenKind}; -use rustc_ast::tokenstream::{Cursor, TokenStream, TokenTree}; +use rustc_ast::tokenstream::{TokenStream, TokenTree, TokenTreeCursor}; use rustc_ast::{ast, ptr}; use rustc_ast_pretty::pprust; use rustc_span::{ @@ -736,7 +736,7 @@ impl MacroArgParser { self.buf.clear(); } - fn add_meta_variable(&mut self, iter: &mut Cursor) -> Option<()> { + fn add_meta_variable(&mut self, iter: &mut TokenTreeCursor) -> Option<()> { match iter.next() { Some(TokenTree::Token( Token { @@ -768,7 +768,7 @@ impl MacroArgParser { &mut self, inner: Vec<ParsedMacroArg>, delim: Delimiter, - iter: &mut Cursor, + iter: &mut TokenTreeCursor, ) -> Option<()> { let mut buffer = String::new(); let mut first = true; @@ -1121,7 +1121,7 @@ pub(crate) fn macro_style(mac: &ast::MacCall, context: &RewriteContext<'_>) -> D // Currently we do not attempt to parse any further than that. #[derive(new)] struct MacroParser { - toks: Cursor, + toks: TokenTreeCursor, } impl MacroParser { |
