Rollup merge of #51789 - estebank:issue-50577, r=oli-obk

Don't ICE when performing `lower_pattern_unadjusted` on a `TyError`

Fix #50577. CC #51696.

r? @oli-obk
This commit is contained in:
Pietro Albini 2018-06-26 11:35:44 +02:00 committed by GitHub
commit f2a099b17f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 11 deletions

View file

@ -0,0 +1,15 @@
// Copyright 2018 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() {
enum Foo {
Drop = assert_eq!(1, 1)
}
}

View file

@ -0,0 +1,13 @@
error[E0317]: if may be missing an else clause
--> $DIR/issue-50577.rs:13:16
|
LL | Drop = assert_eq!(1, 1)
| ^^^^^^^^^^^^^^^^ expected (), found isize
|
= note: expected type `()`
found type `isize`
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to previous error
For more information about this error, try `rustc --explain E0317`.