about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-01-15 13:00:43 +0000
committerbors <bors@rust-lang.org>2020-01-15 13:00:43 +0000
commit6d0bb91bcba33a70fae4b0c663fb4403ed78f071 (patch)
tree49ad0d439dbcdc46e462fc95d9186c46d4c37421 /src/librustc_error_codes/error_codes
parentc74353c7d2e61b111a9241490b9fbbd1ebe491fe (diff)
parentd2840e6bf11969c8b0275149cda25f6ce4ee60ac (diff)
downloadrust-6d0bb91bcba33a70fae4b0c663fb4403ed78f071.tar.gz
rust-6d0bb91bcba33a70fae4b0c663fb4403ed78f071.zip
Auto merge of #68248 - JohnTitor:rollup-x0kml5f, r=JohnTitor
Rollup of 12 pull requests

Successful merges:

 - #67784 (Reset Formatter flags on exit from pad_integral)
 - #67914 (Don't run const propagation on items with inconsistent bounds)
 - #68141 (use winapi for non-stdlib Windows bindings)
 - #68211 (Add failing example for E0170 explanation)
 - #68219 (Untangle ZST validation from integer validation and generalize it to all zsts)
 - #68222 (Update the wasi-libc bundled with libstd)
 - #68226 (Avoid calling tcx.hir().get() on CRATE_HIR_ID)
 - #68227 (Update to a version of cmake with windows arm64 support)
 - #68229 (Update iovec to a version with no winapi dependency)
 - #68230 (Update libssh2-sys to a version that can build for aarch64-pc-windows…)
 - #68231 (Better support for cross compilation on Windows.)
 - #68233 (Update compiler_builtins with changes to fix 128 bit integer remainder for aarch64 windows.)

Failed merges:

r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0170.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0170.md b/src/librustc_error_codes/error_codes/E0170.md
index 4b870dbf221..9678cd173b7 100644
--- a/src/librustc_error_codes/error_codes/E0170.md
+++ b/src/librustc_error_codes/error_codes/E0170.md
@@ -1,3 +1,24 @@
+A pattern binding is using the same name as one of the variants of a type.
+
+Erroneous code example:
+
+```compile_fail,E0170
+# #![deny(warnings)]
+enum Method {
+    GET,
+    POST,
+}
+
+fn is_empty(s: Method) -> bool {
+    match s {
+        GET => true,
+        _ => false
+    }
+}
+
+fn main() {}
+```
+
 Enum variants are qualified by default. For example, given this type:
 
 ```