Skip to content

Commit a28a422

Browse files
committed
Auto merge of #137959 - matthiaskrgr:rollup-62vjvwr, r=matthiaskrgr
Rollup of 12 pull requests Successful merges: - #135767 (Future incompatibility warning `unsupported_fn_ptr_calling_conventions`: Also warn in dependencies) - #137852 (Remove layouting dead code for non-array SIMD types.) - #137863 (Fix pretty printing of unsafe binders) - #137882 (do not build additional stage on compiler paths) - #137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset") - #137902 (Make `ast::TokenKind` more like `lexer::TokenKind`) - #137921 (Subtree update of `rust-analyzer`) - #137922 (A few cleanups after the removal of `cfg(not(parallel))`) - #137939 (fix order on shl impl) - #137946 (Fix docker run-local docs) - #137955 (Always allow rustdoc-json tests to contain long lines) - #137958 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 71310c1 + 88e23c9 commit a28a422

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

src/macros.rs

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use std::collections::HashMap;
1313
use std::panic::{AssertUnwindSafe, catch_unwind};
1414

15-
use rustc_ast::token::{BinOpToken, Delimiter, Token, TokenKind};
15+
use rustc_ast::token::{Delimiter, Token, TokenKind};
1616
use rustc_ast::tokenstream::{TokenStream, TokenStreamIter, TokenTree};
1717
use rustc_ast::{ast, ptr};
1818
use rustc_ast_pretty::pprust;
@@ -841,7 +841,7 @@ impl MacroArgParser {
841841
match tok {
842842
TokenTree::Token(
843843
Token {
844-
kind: TokenKind::BinOp(BinOpToken::Plus),
844+
kind: TokenKind::Plus,
845845
..
846846
},
847847
_,
@@ -855,7 +855,7 @@ impl MacroArgParser {
855855
)
856856
| TokenTree::Token(
857857
Token {
858-
kind: TokenKind::BinOp(BinOpToken::Star),
858+
kind: TokenKind::Star,
859859
..
860860
},
861861
_,
@@ -1088,14 +1088,32 @@ fn force_space_before(tok: &TokenKind) -> bool {
10881088
| TokenKind::Gt
10891089
| TokenKind::AndAnd
10901090
| TokenKind::OrOr
1091-
| TokenKind::Not
1091+
| TokenKind::Bang
10921092
| TokenKind::Tilde
1093-
| TokenKind::BinOpEq(_)
1093+
| TokenKind::PlusEq
1094+
| TokenKind::MinusEq
1095+
| TokenKind::StarEq
1096+
| TokenKind::SlashEq
1097+
| TokenKind::PercentEq
1098+
| TokenKind::CaretEq
1099+
| TokenKind::AndEq
1100+
| TokenKind::OrEq
1101+
| TokenKind::ShlEq
1102+
| TokenKind::ShrEq
10941103
| TokenKind::At
10951104
| TokenKind::RArrow
10961105
| TokenKind::LArrow
10971106
| TokenKind::FatArrow
1098-
| TokenKind::BinOp(_)
1107+
| TokenKind::Plus
1108+
| TokenKind::Minus
1109+
| TokenKind::Star
1110+
| TokenKind::Slash
1111+
| TokenKind::Percent
1112+
| TokenKind::Caret
1113+
| TokenKind::And
1114+
| TokenKind::Or
1115+
| TokenKind::Shl
1116+
| TokenKind::Shr
10991117
| TokenKind::Pound
11001118
| TokenKind::Dollar => true,
11011119
_ => false,
@@ -1113,8 +1131,8 @@ fn next_space(tok: &TokenKind) -> SpaceState {
11131131
debug!("next_space: {:?}", tok);
11141132

11151133
match tok {
1116-
TokenKind::Not
1117-
| TokenKind::BinOp(BinOpToken::And)
1134+
TokenKind::Bang
1135+
| TokenKind::And
11181136
| TokenKind::Tilde
11191137
| TokenKind::At
11201138
| TokenKind::Comma

0 commit comments

Comments
 (0)