Skip to content

Commit bbea4ed

Browse files
committed
---
yaml --- r: 223695 b: refs/heads/beta c: b952c0e h: refs/heads/master i: 223693: a769f35 223691: d0c3381 223687: 6318fae 223679: 509183a v: v3
1 parent 8d9f3c2 commit bbea4ed

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
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: faf73028c9afe5790e9b4d83a348d93e4a098852
26+
refs/heads/beta: b952c0e4e9f3c169c6647fd05fef68ae1119865a
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

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