Skip to content

Commit 6bafc20

Browse files
committed
---
yaml --- r: 123686 b: refs/heads/try c: 8f34b21 h: refs/heads/master v: v3
1 parent ff5b804 commit 6bafc20

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: da4e4e4e0a7778a85748aa4a303b13f603e96b4b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8ddd286ea4ba4384a0dc9eae393ed515460a986e
5-
refs/heads/try: 9ee9c49cb4823c5bddbd9ec1ece6dfafa9e833ea
5+
refs/heads/try: 8f34b21375017aece4ae08fcf13f0dfcc8aca96e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libsyntax/ext/expand.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,10 @@ fn expand_item_mac(it: Gc<ast::Item>, fld: &mut MacroExpander)
512512

513513
let items = match expanded.make_def() {
514514
Some(MacroDef { name, ext }) => {
515-
// yikes... no idea how to apply the mark to this. I'm afraid
516-
// we're going to have to wait-and-see on this one.
515+
// hidden invariant: this should only be possible as the
516+
// result of expanding a LetSyntaxTT, and thus doesn't
517+
// need to be marked. Not that it could be marked anyway.
518+
// create issue to recommend refactoring here?
517519
fld.extsbox.insert(intern(name.as_slice()), ext);
518520
if attr::contains_name(it.attrs.as_slice(), "macro_export") {
519521
SmallVector::one(it)
@@ -1466,6 +1468,15 @@ mod test {
14661468
0)
14671469
}
14681470

1471+
// macro_rules in method position
1472+
#[test] fn macro_in_method_posn(){
1473+
expand_crate_str(
1474+
"macro_rules! my_method (() => fn thirteen(&self) -> int {13})
1475+
struct A;
1476+
impl A{ my_method!()}
1477+
fn f(){A.thirteen;}".to_string());
1478+
}
1479+
14691480
// run one of the renaming tests
14701481
fn run_renaming_test(t: &RenamingTest, test_idx: uint) {
14711482
let invalid_name = token::special_idents::invalid.name;

0 commit comments

Comments
 (0)