From ddb46aaf88148f9b525eef43794f02f5247c0461 Mon Sep 17 00:00:00 2001 From: christopherdumas Date: Wed, 2 Sep 2015 15:48:21 -0700 Subject: [PATCH 1/4] Fix ICE per #28172 --- src/librustc/middle/check_const.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index ad9cbfcf4c05..37e144281760 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -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"); } } } From 0276068255257e17fbb203eb36aee533b60c4cab Mon Sep 17 00:00:00 2001 From: christopherdumas Date: Thu, 10 Sep 2015 20:44:03 -0700 Subject: [PATCH 2/4] Added test --- src/llvm | 2 +- .../compile-fail/non-constant-in-const-path.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/test/compile-fail/non-constant-in-const-path.rs diff --git a/src/llvm b/src/llvm index 874dc4ee4cb7..168f91ce5cbf 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 874dc4ee4cb782056469f003831bcda3e4cdf0df +Subproject commit 168f91ce5cbf8933e47f339911f0f46a48714852 diff --git a/src/test/compile-fail/non-constant-in-const-path.rs b/src/test/compile-fail/non-constant-in-const-path.rs new file mode 100644 index 000000000000..00572237c0ef --- /dev/null +++ b/src/test/compile-fail/non-constant-in-const-path.rs @@ -0,0 +1,16 @@ +// 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 or the MIT license +// , 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 + }; +} From 175a6421b24fa376f23e00b118d2489379b92797 Mon Sep 17 00:00:00 2001 From: christopherdumas Date: Fri, 11 Sep 2015 11:53:45 -0700 Subject: [PATCH 3/4] Fixed test --- src/test/compile-fail/non-constant-in-const-path.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/compile-fail/non-constant-in-const-path.rs b/src/test/compile-fail/non-constant-in-const-path.rs index 00572237c0ef..124a2ffc1854 100644 --- a/src/test/compile-fail/non-constant-in-const-path.rs +++ b/src/test/compile-fail/non-constant-in-const-path.rs @@ -11,6 +11,8 @@ fn main() { let x = 0; match 1 { - 0 ... x => {} //~ ERROR non-constant path in constant expr + 0 ... x => {} + //~^ ERROR non-constant path in constant expr + //~| ERROR paths in constants may only refer to constants or functions }; } From 4611308751ebd77df0411669f469e12d960ee538 Mon Sep 17 00:00:00 2001 From: christopherdumas Date: Sat, 12 Sep 2015 15:26:50 -0700 Subject: [PATCH 4/4] Rwind LLVM --- src/llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm b/src/llvm index 168f91ce5cbf..874dc4ee4cb7 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 168f91ce5cbf8933e47f339911f0f46a48714852 +Subproject commit 874dc4ee4cb782056469f003831bcda3e4cdf0df