Properly coerce never types

This commit is contained in:
Kirill Bulatov
2019-08-15 23:53:42 +03:00
parent 8b612251fd
commit 89f3cc587d
3 changed files with 46 additions and 57 deletions

View File

@@ -3597,11 +3597,9 @@ fn no_such_field_diagnostics() {
mod branching_with_never_tests {
use super::type_at;
use test_utils::covers;
#[test]
fn match_first_arm_never() {
covers!(match_first_arm_never);
let t = type_at(
r#"
//- /main.rs
@@ -3622,7 +3620,6 @@ fn test(a: i32) {
#[test]
fn if_never() {
covers!(if_never);
let t = type_at(
r#"
//- /main.rs
@@ -3642,7 +3639,6 @@ fn test() {
#[test]
fn if_else_never() {
covers!(if_else_never);
let t = type_at(
r#"
//- /main.rs
@@ -3662,7 +3658,6 @@ fn test(input: bool) {
#[test]
fn match_second_arm_never() {
covers!(match_second_arm_never);
let t = type_at(
r#"
//- /main.rs
@@ -3683,7 +3678,6 @@ fn test(a: i32) {
#[test]
fn match_all_arms_never() {
covers!(match_all_arms_never);
let t = type_at(
r#"
//- /main.rs
@@ -3702,7 +3696,6 @@ fn test(a: i32) {
#[test]
fn match_no_never_arms() {
covers!(match_no_never_arms);
let t = type_at(
r#"
//- /main.rs