diff options
| author | Andrew Cann <shum@canndrew.org> | 2017-02-10 00:52:51 +0800 |
|---|---|---|
| committer | Andrew Cann <shum@canndrew.org> | 2017-02-10 00:52:51 +0800 |
| commit | 347bc77c2c01b1cc78d1d4c3ea4cb48f196cee04 (patch) | |
| tree | 547380319ed759380763eb0664652499008c76ea /src/librustc_const_eval | |
| parent | 2bb9c5875d0ab956f7d87c60de34bc3f2a427c1e (diff) | |
Use global recursion limit when evaluating inhabitedness
Diffstat (limited to 'src/librustc_const_eval')
| -rw-r--r-- | src/librustc_const_eval/_match.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_const_eval/_match.rs b/src/librustc_const_eval/_match.rs index 101c43332a3..78c4027aa43 100644 --- a/src/librustc_const_eval/_match.rs +++ b/src/librustc_const_eval/_match.rs @@ -17,7 +17,7 @@ use eval::{compare_const_vals}; use rustc_const_math::ConstInt; -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; +use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::indexed_vec::Idx; use pattern::{FieldPattern, Pattern, PatternKind}; @@ -404,8 +404,8 @@ fn all_constructors<'a, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>, } ty::TyAdt(def, substs) if def.is_enum() && def.variants.len() != 1 => { def.variants.iter().filter_map(|v| { - let mut visited = FxHashSet::default(); - let forest = v.uninhabited_from(&mut visited, 0, + let mut visited = FxHashMap::default(); + let forest = v.uninhabited_from(&mut visited, cx.tcx, substs, AdtKind::Enum); if forest.contains(cx.tcx, cx.module) |
