Skip to content

Commit b1a3b38

Browse files
committed
---
yaml --- r: 123431 b: refs/heads/auto c: 8f34b21 h: refs/heads/master i: 123429: 169784a 123427: dd0c744 123423: eb93b7e v: v3
1 parent 5d48b48 commit b1a3b38

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
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 9ee9c49cb4823c5bddbd9ec1ece6dfafa9e833ea
16+
refs/heads/auto: 8f34b21375017aece4ae08fcf13f0dfcc8aca96e
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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)