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-03-26 12:33:18 +0000
committerbors <bors@rust-lang.org>2020-03-26 12:33:18 +0000
commit2fbb07525e2f07a815e780a4268b11916248b5a9 (patch)
tree45d6837d752b3628506e97f0ac317a258fa3619a /src/librustc_error_codes/error_codes
parent3b1d7351186a073c72e4be3c7d7b7ab8f1f10c58 (diff)
parent608715bbd10ec9a088d46f03db9afa689bfb3c90 (diff)
downloadrust-2fbb07525e2f07a815e780a4268b11916248b5a9.tar.gz
rust-2fbb07525e2f07a815e780a4268b11916248b5a9.zip
Auto merge of #70427 - Centril:rollup-lrcad2c, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #68004 (permit negative impls for non-auto traits)
 - #70385 (Miri nits: comment and var name improvement)
 - #70411 (Fix for #62691: use the largest niche across all fields)
 - #70417 (parser: recover on `...` as a pattern, suggesting `..`)
 - #70424 (simplify match stmt)

Failed merges:

r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0749.md4
-rw-r--r--src/librustc_error_codes/error_codes/E0750.md4
-rw-r--r--src/librustc_error_codes/error_codes/E0751.md12
3 files changed, 20 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0749.md b/src/librustc_error_codes/error_codes/E0749.md
new file mode 100644
index 00000000000..9eb8ee4e3fd
--- /dev/null
+++ b/src/librustc_error_codes/error_codes/E0749.md
@@ -0,0 +1,4 @@
+Negative impls are not allowed to have any items. Negative impls
+declare that a trait is **not** implemented (and never will be) and
+hence there is no need to specify the values for trait methods or
+other items.
diff --git a/src/librustc_error_codes/error_codes/E0750.md b/src/librustc_error_codes/error_codes/E0750.md
new file mode 100644
index 00000000000..e0cf56f716f
--- /dev/null
+++ b/src/librustc_error_codes/error_codes/E0750.md
@@ -0,0 +1,4 @@
+Negative impls cannot be default impls. A default impl supplies
+default values for the items within to be used by other impls, whereas
+a negative impl declares that there are no other impls. These don't
+make sense to combine.
diff --git a/src/librustc_error_codes/error_codes/E0751.md b/src/librustc_error_codes/error_codes/E0751.md
new file mode 100644
index 00000000000..a440f82e4b6
--- /dev/null
+++ b/src/librustc_error_codes/error_codes/E0751.md
@@ -0,0 +1,12 @@
+There are both a positive and negative trait implementation for the same type.
+
+Erroneous code example:
+
+```compile_fail,E0748
+trait MyTrait {}
+impl MyTrait for i32 { }
+impl !MyTrait for i32 { }
+```
+
+Negative implementations are a promise that the trait will never be
+implemented for the given types.