Rebase fallout

This commit is contained in:
Oliver Schneider 2018-02-09 09:38:45 +01:00
parent 2f0e077300
commit d98a2b90b2
No known key found for this signature in database
GPG key ID: A69F8D225B3AD7D9
6 changed files with 22 additions and 1197 deletions

View file

@ -18,7 +18,6 @@ use rustc::middle::const_val::ConstVal;
use rustc::mir::interpret::{GlobalId, Value, PrimVal};
use rustc::ty::{self, AdtKind, VariantDef, Ty};
use rustc::ty::adjustment::{Adjustment, Adjust, AutoBorrow, AutoBorrowMutability};
use rustc::mir::interpret::{Value, PrimVal};
use rustc::ty::cast::CastKind as TyCastKind;
use rustc::hir;
use rustc::hir::def_id::LocalDefId;

View file

@ -42,7 +42,6 @@ pub enum PatternError {
StaticInPattern(Span),
FloatBug,
NonConstPath(Span),
AssociatedConstInPattern(Span),
}
#[derive(Copy, Clone, Debug)]
@ -382,10 +381,24 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
"lower range bound must be less than upper",
),
(RangeEnd::Included, Ordering::Greater) => {
struct_span_err!(self.tcx.sess, lo_expr.span, E0030,
"lower range bound must be less than or equal to upper")
.span_label(lo_expr.span, "lower bound larger than upper bound")
.emit();
let mut err = struct_span_err!(
self.tcx.sess,
lo_expr.span,
E0030,
"lower range bound must be less than or equal to upper"
);
err.span_label(
lo_expr.span,
"lower bound larger than upper bound",
);
if self.tcx.sess.teach(&err.get_code().unwrap()) {
err.note("When matching against a range, the compiler \
verifies that the range is non-empty. Range \
patterns include both end-points, so this is \
equivalent to requiring the start of the range \
to be less than or equal to the end of the range.");
}
err.emit();
},
(RangeEnd::Included, _) => {}
}

File diff suppressed because it is too large Load diff

View file

@ -81,8 +81,8 @@ impl<'a, 'tcx> Visitor<'tcx> for UniformArrayMoveOutVisitor<'a, 'tcx> {
} else {
let place_ty = proj.base.ty(self.mir, self.tcx).to_ty(self.tcx);
if let ty::TyArray(item_ty, const_size) = place_ty.sty {
if let Some(size) = const_size.val.to_const_int().and_then(|v| v.to_u64()) {
assert!(size <= (u32::max_value() as u64),
if let Some(size) = const_size.val.to_raw_bits() {
assert!(size <= (u32::max_value() as u128),
"unform array move out doesn't supported
for array bigger then u32");
self.uniform(location, dst_place, proj, item_ty, size as u32);

View file

@ -239,7 +239,7 @@ fn main() {
// _11 = const guard2(move _12) -> [return: bb14, unwind: bb1];
// }
// bb14: { // end of guard2
// StorageDead(_11);
// StorageDead(_12);
// switchInt(move _11) -> [false: bb15, otherwise: bb3];
// }
// bb15: { // to pre_binding4

View file

@ -11,7 +11,7 @@
// compile-flags: -Z teach
fn main() {
match 5u32 {
match 5u32 { //~ERROR non-exhaustive patterns: `_` not covered
1000 ... 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
}