From c3d147eea60c891823e7e1c21003c392654a633b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 7 Aug 2015 15:23:00 +0200 Subject: [PATCH] Add a guard example for E0416 --- src/librustc_resolve/diagnostics.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 5fe1e286917..b758260ac2b 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -494,6 +494,15 @@ match (1, 2) { (x, y) => {} // ok! } ``` + +Or maybe did you mean to unify? Consider using a guard: + +``` +match (A, B, C) { + (x, x2, see) if x == x2 => { /* A and B are equal, do one thing */ } + (y, z, see) => { /* A and B unequal; do another thing */ } +} +``` "##, E0417: r##"