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

Forbid type parameters and global paths in macro invocations #34495

Merged
merged 2 commits into from
Jun 30, 2016

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Jun 27, 2016

Fixes #28558.
This is a [breaking-change]. For example, the following would break:

macro_rules! m { () => { () } }
fn main() {
    m::<T>!(); // Type parameters are no longer allowed in macro invocations
    ::m!(); // Global paths are no longer allowed in macro invocations
}

Any breakage can be fixed by removing the type parameters or the leading :: (respectively).

r? @eddyb

@jseyfried
Copy link
Contributor Author

This probably needs a crater run.

@eddyb
Copy link
Member

eddyb commented Jun 27, 2016

Starting a crater run.

@eddyb
Copy link
Member

eddyb commented Jun 27, 2016

Crater report shows 0 regressions.

@eddyb
Copy link
Member

eddyb commented Jun 27, 2016

LGTM. cc @nrc @Manishearth

@Manishearth
Copy link
Member

LGTM too. Since this doesn't actually change the grammar, it doesn't need to be part of the breaking batch either.

@jseyfried
Copy link
Contributor Author

@eddyb r=you?

@eddyb
Copy link
Member

eddyb commented Jun 27, 2016

@jseyfried I'd like to hear back from another compiler/lang team member, like @nrc or @nikomatsakis (but niko is on vacation right now and might not respond for a while).

Or maybe we should require that, e.g. for language breaking changes, you notify @rust-lang/lang.

@jseyfried
Copy link
Contributor Author

jseyfried commented Jun 27, 2016

@eddyb ok, makes sense -- no hurry.

We usually land clear bug fixes that cause no measurable breakage in practice without much discussion (perhaps we shouldn't).

@nrc
Copy link
Member

nrc commented Jun 27, 2016

LGTM

@bors: r=eddyb

@bors
Copy link
Contributor

bors commented Jun 27, 2016

📌 Commit b4611b1 has been approved by eddyb

Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 29, 2016
…ons, r=eddyb

Forbid type parameters and global paths in macro invocations

Fixes rust-lang#28558.
This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => { () } }
fn main() {
    m::<T>!(); // Type parameters are no longer allowed in macro invocations
    ::m!(); // Global paths are no longer allowed in macro invocations
}
```
Any breakage can be fixed by removing the type parameters or the leading `::` (respectively).

r? @eddyb
bors added a commit that referenced this pull request Jun 30, 2016
Rollup of 11 pull requests

- Successful merges: #34355, #34446, #34459, #34460, #34467, #34495, #34497, #34499, #34513, #34536, #34542
- Failed merges:
@bors bors merged commit b4611b1 into rust-lang:master Jun 30, 2016
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.

Macro invocations allow type parameters in the path
5 participants