summary refs log tree commit diff
path: root/src/test/compile-fail/macro-incomplete-parse.rs
AgeCommit message (Collapse)AuthorLines
2015-01-05Un-gate macro_rulesKeegan McAllister-2/+0
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-2/+2
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]
2014-05-28Test pattern macrosKeegan McAllister-0/+8
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-1/+1
Closes #2569
2013-11-26Support multiple item macrosSteven Fackler-1/+2
Closes #4375
2013-10-06Add appropriate #[feature] directives to testsAlex Crichton-0/+2
2013-10-02syntax: indicate an error when a macro ignores trailing tokens.Huon Wilson-0/+26
That is, only a single expression or item gets parsed, so if there are any extra tokens (e.g. the start of another item/expression) the user should be told, rather than silently dropping them. An example: macro_rules! foo { () => { println("hi"); println("bye); } } would expand to just `println("hi")`, which is almost certainly not what the programmer wanted. Fixes #8012.