Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librustc: Always parse
macro!()
/macro![]
as expressions if not
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
- Loading branch information
Showing
222 changed files
with
2,338 additions
and
2,047 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ddb2466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at japaric@ddb2466
ddb2466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging japaric/rust/macro-expressions = ddb2466 into auto
ddb2466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status: {"merge_sha": "f9a48492a82f805aa40d8b6fea290badbab0d1b1"}
ddb2466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
japaric/rust/macro-expressions = ddb2466 merged ok, testing candidate = f9a4849
ddb2466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/2743
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/2738
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/2739
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/2730
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/2729
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/2733
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/2725
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2725
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/2391
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2388
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/1230
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/1223
ddb2466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = f9a4849
ddb2466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = f9a4849