Skip to content

Commit 84cbfc3

Browse files
committed
---
yaml --- r: 218331 b: refs/heads/tmp c: b952c0e h: refs/heads/master i: 218329: cf84507 218327: 9bf68cf v: v3
1 parent e192bc1 commit 84cbfc3

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
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: ebf0c83cb9c6508e9564cb58337df2ad52b56430
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: faf73028c9afe5790e9b4d83a348d93e4a098852
28+
refs/heads/tmp: b952c0e4e9f3c169c6647fd05fef68ae1119865a
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: d0fdfbfb0d34f196f52b9d15215723c4785c4afa
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

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