Skip to content

Commit 296b801

Browse files
committed
---
yaml --- r: 235278 b: refs/heads/stable c: b952c0e h: refs/heads/master v: v3
1 parent c98be2b commit 296b801

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
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: faf73028c9afe5790e9b4d83a348d93e4a098852
32+
refs/heads/stable: b952c0e4e9f3c169c6647fd05fef68ae1119865a
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

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