about summary refs log tree commit diff
path: root/src/librustc_const_eval
diff options
context:
space:
mode:
authorAndrew Cann <shum@canndrew.org>2016-11-09 17:55:57 +0800
committerAndrew Cann <shum@canndrew.org>2016-11-22 13:22:31 +0800
commitd756f61a5a7ab84d58fdaa9d53d84f6dad29f8db (patch)
treec56b85f11021792f673249fbb140944c7a3e316c /src/librustc_const_eval
parenta6cc398207009884a2885855e79ba424c2f4c303 (diff)
Make is_uninhabited respect privacy
Diffstat (limited to 'src/librustc_const_eval')
-rw-r--r--src/librustc_const_eval/check_match.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs
index f63a27e0d75..3c94d7d6fd5 100644
--- a/src/librustc_const_eval/check_match.rs
+++ b/src/librustc_const_eval/check_match.rs
@@ -204,7 +204,7 @@ impl<'a, 'tcx> MatchVisitor<'a, 'tcx> {
             // Check for empty enum, because is_useful only works on inhabited types.
             let pat_ty = self.tcx.tables().node_id_to_type(scrut.id);
             if inlined_arms.is_empty() {
-                if !pat_ty.is_uninhabited(self.tcx) {
+                if !pat_ty.is_uninhabited(Some(scrut.id), self.tcx) {
                     // We know the type is inhabited, so this must be wrong
                     let mut err = create_e0004(self.tcx.sess, span,
                                                format!("non-exhaustive patterns: type {} \