Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3caf0bc
Accept `m!{ .. }.method()` and `m!{ .. }?` statements.
m-ou-se Sep 6, 2021
ebf1252
Add test for braced-macro followed by `.` or `?`.
m-ou-se Sep 6, 2021
2691a39
Revert "Allow formatting `Anonymous{Struct, Union}` declarations"
pnkfelix Sep 8, 2021
2041fb1
Revert "Add test for pretty printing anonymous types"
pnkfelix Sep 8, 2021
5560f6d
Revert "Fix ast expanded printing for anonymous types"
pnkfelix Sep 8, 2021
f38ec9c
Revert "Add test for restriction of anonymous types on validation"
pnkfelix Sep 8, 2021
b6aa7e3
Manually crafted revert of d4ad050ce5778a09566f6f9ec172565815d54604 .
pnkfelix Sep 8, 2021
91feb76
Revert "Implement Anonymous{Struct, Union} in the AST"
pnkfelix Sep 8, 2021
f26f1ed
Re-add 71a7f8f1884b2c83eeb4a545eef16df1f2ea6476 post-revert.
pnkfelix Sep 8, 2021
35370a7
regression test for issue #88583.
pnkfelix Sep 9, 2021
5dab3c5
feat(rustc_typeck): suggest removing bad parens in `(recv.method)()`
notriddle Sep 11, 2021
e5c2412
Add the corrections stuff to the 88803 test case
notriddle Sep 11, 2021
d98892b
Make sure the call span parens check only fires on the callee, not args
notriddle Sep 11, 2021
8be729c
chore: convert to a multi-part suggestion
notriddle Sep 13, 2021
6ec7255
Highlight the const function if error happened because of a bound on …
WaffleLapkin Sep 13, 2021
7d8d7a0
Add negative test in macro-braces-dot-question.rs.
m-ou-se Sep 13, 2021
1053a5b
`Wrapping<T>` has the same layout and ABI as `T`
joshlf Sep 13, 2021
f9b8191
Remove implementation of `min_align_of` intrinsic
tmiasko Sep 14, 2021
a3115b3
Update books
ehuss Sep 15, 2021
4682a8c
Rollup merge of #88690 - m-ou-se:macro-braces-dot-question-expr-parse…
Manishearth Sep 15, 2021
95306c6
Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwco
Manishearth Sep 15, 2021
293eb80
Rollup merge of #88841 - notriddle:notriddle/method-parens, r=estebank
Manishearth Sep 15, 2021
fdac4c0
Rollup merge of #88907 - WaffleLapkin:targeted_const_fn_with_a_bound_…
Manishearth Sep 15, 2021
0ced81e
Rollup merge of #88915 - joshlf:patch-4, r=kennytm
Manishearth Sep 15, 2021
58cda93
Rollup merge of #88933 - tmiasko:remove-min-align-of, r=oli-obk
Manishearth Sep 15, 2021
d9a7279
Rollup merge of #88951 - ehuss:update-books, r=ehuss
Manishearth Sep 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Accept m!{ .. }.method() and m!{ .. }? statements.
  • Loading branch information
m-ou-se committed Sep 6, 2021
commit 3caf0bcdeb9546bd8a3ab58c0e33baabdcaac75a
25 changes: 14 additions & 11 deletions compiler/rustc_parse/src/parser/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,20 @@ impl<'a> Parser<'a> {

let mac = MacCall { path, args, prior_type_ascription: self.last_type_ascription };

let kind = if delim == token::Brace || self.token == token::Semi || self.token == token::Eof
{
StmtKind::MacCall(P(MacCallStmt { mac, style, attrs, tokens: None }))
} else {
// Since none of the above applied, this is an expression statement macro.
let e = self.mk_expr(lo.to(hi), ExprKind::MacCall(mac), AttrVec::new());
let e = self.maybe_recover_from_bad_qpath(e, true)?;
let e = self.parse_dot_or_call_expr_with(e, lo, attrs.into())?;
let e = self.parse_assoc_expr_with(0, LhsExpr::AlreadyParsed(e))?;
StmtKind::Expr(e)
};
let kind =
if (delim == token::Brace && self.token != token::Dot && self.token != token::Question)
|| self.token == token::Semi
|| self.token == token::Eof
{
StmtKind::MacCall(P(MacCallStmt { mac, style, attrs, tokens: None }))
} else {
// Since none of the above applied, this is an expression statement macro.
let e = self.mk_expr(lo.to(hi), ExprKind::MacCall(mac), AttrVec::new());
let e = self.maybe_recover_from_bad_qpath(e, true)?;
let e = self.parse_dot_or_call_expr_with(e, lo, attrs.into())?;
let e = self.parse_assoc_expr_with(0, LhsExpr::AlreadyParsed(e))?;
StmtKind::Expr(e)
};
Ok(self.mk_stmt(lo.to(hi), kind))
}

Expand Down