diff options
| author | Andrew Cann <shum@canndrew.org> | 2016-11-09 17:55:57 +0800 |
|---|---|---|
| committer | Andrew Cann <shum@canndrew.org> | 2016-11-22 13:22:31 +0800 |
| commit | d756f61a5a7ab84d58fdaa9d53d84f6dad29f8db (patch) | |
| tree | c56b85f11021792f673249fbb140944c7a3e316c /src/librustc_const_eval | |
| parent | a6cc398207009884a2885855e79ba424c2f4c303 (diff) | |
Make is_uninhabited respect privacy
Diffstat (limited to 'src/librustc_const_eval')
| -rw-r--r-- | src/librustc_const_eval/check_match.rs | 2 |
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 {} \ |
