File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 08d870e566b04fcc672c8a35996b40ce9e22ed06
4
+ refs/heads/snap-stage3: 6e5705a87743503232ec927efebd00861f1ce717
5
5
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -4290,7 +4290,8 @@ pub fn eval_repeat_count(tcx: ctxt,
4290
4290
count_expr: @ast::expr,
4291
4291
span: span)
4292
4292
-> uint {
4293
- match const_eval::eval_const_expr(tcx, count_expr) {
4293
+ match const_eval::eval_const_expr_partial(tcx, count_expr) {
4294
+ Ok(ref const_val) => match *const_val {
4294
4295
const_eval::const_int(count) => return count as uint,
4295
4296
const_eval::const_uint(count) => return count as uint,
4296
4297
const_eval::const_float(count) => {
@@ -4311,7 +4312,13 @@ pub fn eval_repeat_count(tcx: ctxt,
4311
4312
repeat count but found boolean");
4312
4313
return 0;
4313
4314
}
4314
-
4315
+ },
4316
+ Err(*) => {
4317
+ tcx.sess.span_err(span,
4318
+ ~" expected constant integer for repeat count \
4319
+ but found variable");
4320
+ return 0;
4321
+ }
4315
4322
}
4316
4323
}
4317
4324
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // Regression test for issue #3645
12
+
13
+ fn main ( ) {
14
+ let n = 1 ;
15
+ let a = ~[ 0 , ..n] ; //~ ERROR expected constant integer for repeat count but found variable
16
+ }
You can’t perform that action at this time.
0 commit comments