diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-03 10:55:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-03 10:55:37 +0100 |
commit | 50936397cc4e34712b18cd337facef527fa20b48 (patch) | |
tree | 709dac4e04b492c16829e299bbaf6f2377f0f3a0 /crates/hir_ty/src/diagnostics/match_check | |
parent | e8e14e1b13b76aaa643bc3beffb9c52bc5228d24 (diff) | |
parent | 0a8c30a96fe09047da07a8e2980baa47a334a3d7 (diff) |
Merge #9105
9105: internal: calculate pattern adjustments r=flodiebold a=iDawer
This extends `InferenceResult` with `pub pat_adjustments: FxHashMap<PatId, Vec<Ty>>`.
Fixes #9095
Co-authored-by: Dawer <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/diagnostics/match_check')
-rw-r--r-- | crates/hir_ty/src/diagnostics/match_check/usefulness.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/hir_ty/src/diagnostics/match_check/usefulness.rs b/crates/hir_ty/src/diagnostics/match_check/usefulness.rs index 83b094a89..bd76a606c 100644 --- a/crates/hir_ty/src/diagnostics/match_check/usefulness.rs +++ b/crates/hir_ty/src/diagnostics/match_check/usefulness.rs | |||
@@ -295,7 +295,7 @@ pub(crate) struct MatchCheckCtx<'a> { | |||
295 | pub(crate) db: &'a dyn HirDatabase, | 295 | pub(crate) db: &'a dyn HirDatabase, |
296 | /// Lowered patterns from arms plus generated by the check. | 296 | /// Lowered patterns from arms plus generated by the check. |
297 | pub(crate) pattern_arena: &'a RefCell<PatternArena>, | 297 | pub(crate) pattern_arena: &'a RefCell<PatternArena>, |
298 | pub(crate) eprint_panic_context: &'a dyn Fn(), | 298 | pub(crate) panic_context: &'a dyn Fn() -> String, |
299 | } | 299 | } |
300 | 300 | ||
301 | impl<'a> MatchCheckCtx<'a> { | 301 | impl<'a> MatchCheckCtx<'a> { |
@@ -331,8 +331,7 @@ impl<'a> MatchCheckCtx<'a> { | |||
331 | 331 | ||
332 | #[track_caller] | 332 | #[track_caller] |
333 | pub(super) fn bug(&self, info: &str) -> ! { | 333 | pub(super) fn bug(&self, info: &str) -> ! { |
334 | (self.eprint_panic_context)(); | 334 | panic!("bug: {}\n{}", info, (self.panic_context)()); |
335 | panic!("bug: {}", info); | ||
336 | } | 335 | } |
337 | } | 336 | } |
338 | 337 | ||