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

Implement parse macro!() / macro![] as expr (RFC 378) #18635

Closed
pnkfelix opened this issue Nov 4, 2014 · 2 comments · Fixed by #19984
Closed

Implement parse macro!() / macro![] as expr (RFC 378) #18635

pnkfelix opened this issue Nov 4, 2014 · 2 comments · Fixed by #19984
Milestone

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Nov 4, 2014

Tracking issue for RFC 378.

RFC document: https://github.com/rust-lang/rfcs/blob/master/text/0378-expr-macros.md

@pnkfelix pnkfelix changed the title Implement parsing macro!() / macro![] as expr (RFC PR 378) Implement parsing macro!() / macro![] as expr (RFC 378) Nov 4, 2014
@pnkfelix pnkfelix changed the title Implement parsing macro!() / macro![] as expr (RFC 378) Implement parse macro!() / macro![] as expr (RFC 378) Nov 4, 2014
@pnkfelix
Copy link
Member Author

pnkfelix commented Nov 4, 2014

Nominating (I suggest P-backcompat-lang, 1.0)

@pnkfelix
Copy link
Member Author

pnkfelix commented Nov 6, 2014

Assigning P-backcompat-lang, 1.0.

@pnkfelix pnkfelix added this to the 1.0 milestone Nov 6, 2014
pcwalton added a commit to pcwalton/rust that referenced this issue Nov 19, 2014
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 rust-lang#378.

Closes rust-lang#18635.

[breaking-change]
japaric pushed a commit to japaric/rust that referenced this issue Dec 18, 2014
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 rust-lang#378.

Closes rust-lang#18635.

[breaking-change]
bors added a commit that referenced this issue Dec 18, 2014
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]

---

Rebased version of #18958
r? @alexcrichton 
cc @pcwalton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant