Auto merge of #28178 - christopherdumas:fix_ice, r=nikomatsakis

This fixes the ICE, and makes it just a compiler error/warning. I'm not exactly sure that's whats wanted, so tell me if it isn't.
This commit is contained in:
bors 2015-09-13 21:27:07 +00:00
commit 483600e65f
2 changed files with 20 additions and 2 deletions

View File

@ -378,8 +378,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
"lower range bound must be less than or equal to upper");
}
None => {
self.tcx.sess.span_bug(
start.span, "literals of different types in range pat");
self.tcx.sess.delay_span_bug(start.span,
"non-constant path in constant expr");
}
}
}

View File

@ -0,0 +1,18 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
let x = 0;
match 1 {
0 ... x => {}
//~^ ERROR non-constant path in constant expr
//~| ERROR paths in constants may only refer to constants or functions
};
}