Skip to content

Commit afc8532

Browse files
committed
---
yaml --- r: 228207 b: refs/heads/try c: b952c0e h: refs/heads/master i: 228205: e740a16 228203: cd3c6f4 228199: e0fd343 228191: c4f6d2d v: v3
1 parent 9414120 commit afc8532

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: faf73028c9afe5790e9b4d83a348d93e4a098852
4+
refs/heads/try: b952c0e4e9f3c169c6647fd05fef68ae1119865a
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc/middle/check_static_recursion.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ struct CheckCrateVisitor<'a, 'ast: 'a> {
2727
sess: &'a Session,
2828
def_map: &'a DefMap,
2929
ast_map: &'a ast_map::Map<'ast>,
30+
// `discriminant_map` is a cache that associates the `NodeId`s of local
31+
// variant definitions with the discriminant expression that applies to
32+
// each one. If the variant uses the default values (starting from `0`),
33+
// then `None` is stored.
3034
discriminant_map: RefCell<NodeMap<Option<&'ast ast::Expr>>>,
3135
}
3236

branches/try/src/test/compile-fail/issue-23302.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// Check that an enum with recursion in the discriminant throws
12+
// the appropriate error (rather than, say, blowing the stack).
1113
enum X {
1214
A = X::A as isize, //~ ERROR E0265
1315
}
1416

17+
// Since `Y::B` here defaults to `Y::A+1`, this is also a
18+
// recursive definition.
1519
enum Y {
1620
A = Y::B as isize, //~ ERROR E0265
1721
B,

0 commit comments

Comments
 (0)