Merged
Conversation
Contributor
Author
|
cc #35896 |
Member
to clarify - this PR doesn't actually allow any changes to the actual importing behaviour of such macros, it just lays internal groundwork to allow this in the future? |
Contributor
Author
|
Right, the only observable change from this PR is restricting where |
Member
|
@bors: r+ |
Collaborator
|
📌 Commit 2676b25 has been approved by |
Collaborator
|
🔒 Merge conflict |
Collaborator
|
☔ The latest upstream changes (presumably #37269) made this pull request unmergeable. Please resolve the merge conflicts. |
2676b25 to
8b0c292
Compare
Contributor
Author
|
@bors r=nrc |
Collaborator
|
📌 Commit 8b0c292 has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
Oct 19, 2016
macros: improve `$crate`
This PR refactors the implementation of `$crate` so that
- `$crate` is only allowed at the start of a path (like `super`),
- we can make `$crate` work with inter-crate re-exports (groundwork for macro modularization), and
- we can support importing macros from an extern crate that is not declared at the crate root (also groundwork for macro modularization).
This is a [breaking-change]. For example, the following would break:
```rust
fn foo() {}
macro_rules! m { () => {
$crate foo $crate () $crate $crate;
//^ Today, `$crate` is allowed just about anywhere in unexported macros.
} }
fn main() {
m!();
}
```
r? @nrc
Collaborator
This was referenced Oct 22, 2016
This was referenced Nov 7, 2016
bors
added a commit
that referenced
this pull request
Nov 10, 2016
Fix regression involving custom derives on items with `$crate` The regression was introduced in #37213. I believe we cannot make the improvements from #37213 work with the current custom derive setup (c.f. #37637 (comment)) -- we'll have to wait for `TokenStream`'s API to improve. Fixes #37637. r? @nrc
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the implementation of
$crateso that$crateis only allowed at the start of a path (likesuper),$cratework with inter-crate re-exports (groundwork for macro modularization), andThis is a [breaking-change]. For example, the following would break:
r? @nrc