Skip to content

Conversation

@japaric
Copy link
Contributor

@japaric japaric commented 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

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 pull request 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
@nikomatsakis
Copy link
Contributor

💃 I was wondering what would become of this PR

@bors bors merged commit ddb2466 into rust-lang:master Dec 18, 2014
milibopp added a commit to milibopp/nalgebra that referenced this pull request Dec 19, 2014
This is a fix for the latest nightly, see
rust-lang/rust#19984.
@japaric japaric deleted the macro-expressions branch December 20, 2014 12:30
@Ryman Ryman mentioned this pull request Dec 25, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Jun 16, 2025
remove `pref_align_of` intrinsic handling, rename `{min_=>}align_of{,_val}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

5 participants