Skip to content

Commit 0492d04

Browse files
committed
---
yaml --- r: 152915 b: refs/heads/try2 c: ee1ee7f h: refs/heads/master i: 152913: 378b6bc 152911: a31d11b v: v3
1 parent 98e6691 commit 0492d04

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 235ca1801ec8053b7cab46ed6708c382e58df63b
8+
refs/heads/try2: ee1ee7f463240ebda33d2180dd54be7a5e7f923c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/test/run-pass/issue-8851.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,28 @@
1010

1111
#![feature(macro_rules)]
1212

13+
// after fixing #9384 and implementing hygiene for match bindings,
14+
// this now fails because the insertion of the 'y' into the match
15+
// doesn't cause capture. Making this macro hygienic (as I've done)
16+
// could very well make this test case completely pointless....
17+
1318
enum T {
1419
A(int),
1520
B(uint)
1621
}
1722

1823
macro_rules! test(
19-
($e:expr) => (
24+
($id:ident, $e:expr) => (
2025
fn foo(t: T) -> int {
2126
match t {
22-
A(y) => $e,
23-
B(y) => $e
27+
A($id) => $e,
28+
B($id) => $e
2429
}
2530
}
2631
)
2732
)
2833

29-
test!(10 + (y as int))
34+
test!(y, 10 + (y as int))
3035

3136
pub fn main() {
3237
foo(A(20));

branches/try2/src/test/run-pass/typeck-macro-interaction-issue-8852.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,24 @@ enum T {
1515
B(f64)
1616
}
1717

18+
// after fixing #9384 and implementing hygiene for match bindings,
19+
// this now fails because the insertion of the 'y' into the match
20+
// doesn't cause capture. Making this macro hygienic (as I've done)
21+
// could very well make this test case completely pointless....
22+
1823
macro_rules! test(
19-
($e:expr) => (
24+
($id1:ident, $id2:ident, $e:expr) => (
2025
fn foo(a:T, b:T) -> T {
2126
match (a, b) {
22-
(A(x), A(y)) => A($e),
23-
(B(x), B(y)) => B($e),
27+
(A($id1), A($id2)) => A($e),
28+
(B($id1), B($id2)) => B($e),
2429
_ => fail!()
2530
}
2631
}
2732
)
2833
)
2934

30-
test!(x + y)
35+
test!(x,y,x + y)
3136

3237
pub fn main() {
3338
foo(A(1), A(2));

0 commit comments

Comments
 (0)