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:
commit
483600e65f
2 changed files with 20 additions and 2 deletions
18
src/test/compile-fail/non-constant-in-const-path.rs
Normal file
18
src/test/compile-fail/non-constant-in-const-path.rs
Normal 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
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue