Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow block_in_if_{stmt,expr} in external macro #4458

Merged
merged 2 commits into from
Sep 9, 2019

Conversation

flip1995
Copy link
Member

I found this by running cargo fix --clippy on quite a big codebase.

You could refactor this assert to

let block_expr = _;
assert!(block_expr);

but,

  1. it doesn't increase the readability IMO
  2. That isn't possible in a debug_assert!

I'm not sure though, if we should allow this for macros in general or just for external macros.

changelog: Allow block_in_if_{stmt,expr} in external macros

@flip1995 flip1995 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 27, 2019
@phansch
Copy link
Member

phansch commented Sep 9, 2019

I'm not sure though, if we should allow this for macros in general or just for external macros.

We can always adjust it later, so I think that's fine for now.

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 9, 2019

📌 Commit e7d8cf8 has been approved by phansch

@bors
Copy link
Collaborator

bors commented Sep 9, 2019

⌛ Testing commit e7d8cf8 with merge 8af4e09...

bors added a commit that referenced this pull request Sep 9, 2019
Allow block_in_if_{stmt,expr} in external macro

I found this by running `cargo fix --clippy` on quite a big codebase.

You could refactor this assert to
```rust
let block_expr = _;
assert!(block_expr);
```

but,
1. it doesn't increase the readability IMO
2. That isn't possible in a `debug_assert!`

I'm not sure though, if we should allow this for macros in general or just for external macros.

changelog: Allow `block_in_if_{stmt,expr}` in external macros
@bors
Copy link
Collaborator

bors commented Sep 9, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: phansch
Pushing 8af4e09 to master...

@bors bors merged commit e7d8cf8 into rust-lang:master Sep 9, 2019
@flip1995 flip1995 deleted the block_in_if_ext_macro branch September 10, 2019 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants