Skip to content

Commit 9aee7ed

Browse files
committedJan 13, 2019
Auto merge of #57580 - Centril:rollup, r=Centril
Rollup of 4 pull requests Successful merges: - #56874 (Simplify foreign type rendering.) - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics) - #57366 (Point at match discriminant on type error in match arm pattern) - #57538 (librustc_mir: Fix ICE with slice patterns) Failed merges: - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms) r? @ghost
2 parents 2fadb0a + 35af111 commit 9aee7ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+419
-220
lines changed
 

‎src/librustc/dep_graph/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ impl DepGraph {
696696

697697
// Promote the previous diagnostics to the current session.
698698
tcx.queries.on_disk_cache
699-
.store_diagnostics(dep_node_index, diagnostics.clone());
699+
.store_diagnostics(dep_node_index, diagnostics.clone().into());
700700

701701
for diagnostic in diagnostics {
702702
DiagnosticBuilder::new_diagnostic(handle, diagnostic).emit();

‎src/librustc/infer/error_reporting/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,11 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
487487

488488
fn note_error_origin(&self, err: &mut DiagnosticBuilder<'tcx>, cause: &ObligationCause<'tcx>) {
489489
match cause.code {
490+
ObligationCauseCode::MatchExpressionArmPattern { span, ty } => {
491+
if ty.is_suggestable() { // don't show type `_`
492+
err.span_label(span, format!("this match expression has type `{}`", ty));
493+
}
494+
}
490495
ObligationCauseCode::MatchExpressionArm { arm_span, source } => match source {
491496
hir::MatchSource::IfLetDesugar { .. } => {
492497
let msg = "`if let` arm with an incompatible type";

0 commit comments

Comments
 (0)
Please sign in to comment.