diff options
| author | bors <bors@rust-lang.org> | 2016-07-13 01:37:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-13 01:37:07 -0700 |
| commit | 2ab18ce6f7e147a71e953b9a01ed09aff6b95972 (patch) | |
| tree | 376726d4299079f5a88cf6c54e6ed601921b11d8 /src/doc | |
| parent | 617039bff0decea56b6698497b589671b0371507 (diff) | |
| parent | 57fac56cb51d1a8ca0f6d76f869ccbb0a67b0f45 (diff) | |
| download | rust-2ab18ce6f7e147a71e953b9a01ed09aff6b95972.tar.gz rust-2ab18ce6f7e147a71e953b9a01ed09aff6b95972.zip | |
Auto merge of #34660 - jseyfried:fix_parse_stmt, r=nrc
Fix bugs in macro-expanded statement parsing
Fixes #34543.
This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => {
println!("") println!("")
//^ Semicolons are now required on macro-expanded non-braced macro invocations
//| in statement positions.
let x = 0
//^ Semicolons are now required on macro-expanded `let` statements
//| that are followed by more statements, so this would break.
let y = 0 //< (this would still be allowed to reduce breakage in the wild)
}
fn main() { m!() }
```
r? @eddyb
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/book/macros.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/book/macros.md b/src/doc/book/macros.md index f535fb96af8..9f40829f423 100644 --- a/src/doc/book/macros.md +++ b/src/doc/book/macros.md @@ -328,7 +328,7 @@ invocation site. Code such as the following will not work: ```rust,ignore macro_rules! foo { - () => (let x = 3); + () => (let x = 3;); } fn main() { @@ -342,7 +342,7 @@ tagged with the right syntax context. ```rust macro_rules! foo { - ($v:ident) => (let $v = 3); + ($v:ident) => (let $v = 3;); } fn main() { |
