Skip to content

Commit

Permalink
Fix tidy error
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Jan 19, 2018
1 parent 768cbbc commit c4d0bb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustc/ty/inhabitedness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
},
TyArray(ty, len) => {
match len.val.to_const_int().and_then(|i| i.to_u64()) {
Some(n) if n != 0 => ty.uninhabited_from(visited, tcx),
// If the array is definitely non-empty, it's uninhabited if
// the type of its elements is uninhabited.
Some(n) if n != 0 => ty.uninhabited_from(visited, tcx),
_ => DefIdForest::empty()
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/test/compile-fail/empty-never-array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ enum Helper<T, U> {
}

fn transmute<T, U>(t: T) -> U {
let Helper::U(u) = Helper::T(t, []); //~ ERROR refutable pattern in local binding: `T(_, _)` not covered
let Helper::U(u) = Helper::T(t, []);
//~^ ERROR refutable pattern in local binding: `T(_, _)` not covered
u
}

Expand Down

0 comments on commit c4d0bb3

Please sign in to comment.