提交 483600e6 编写于 作者: B bors

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.
......@@ -378,8 +378,8 @@ fn visit_pat(&mut self, p: &hir::Pat) {
"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");
}
}
}
......
// 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
};
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册