about summary refs log tree commit diff
path: root/src/librustc_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
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')
-rw-r--r--src/librustc_error_codes/error_codes.rs5
-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
4 files changed, 24 insertions, 1 deletions
diff --git a/src/librustc_error_codes/error_codes.rs b/src/librustc_error_codes/error_codes.rs
index 86da425060e..fdcf3d63957 100644
--- a/src/librustc_error_codes/error_codes.rs
+++ b/src/librustc_error_codes/error_codes.rs
@@ -97,7 +97,6 @@ E0184: include_str!("./error_codes/E0184.md"),
 E0185: include_str!("./error_codes/E0185.md"),
 E0186: include_str!("./error_codes/E0186.md"),
 E0191: include_str!("./error_codes/E0191.md"),
-E0192: include_str!("./error_codes/E0192.md"),
 E0193: include_str!("./error_codes/E0193.md"),
 E0195: include_str!("./error_codes/E0195.md"),
 E0197: include_str!("./error_codes/E0197.md"),
@@ -426,6 +425,9 @@ E0745: include_str!("./error_codes/E0745.md"),
 E0746: include_str!("./error_codes/E0746.md"),
 E0747: include_str!("./error_codes/E0747.md"),
 E0748: include_str!("./error_codes/E0748.md"),
+E0749: include_str!("./error_codes/E0749.md"),
+E0750: include_str!("./error_codes/E0750.md"),
+E0751: include_str!("./error_codes/E0751.md"),
 ;
 //  E0006, // merged with E0005
 //  E0008, // cannot bind by-move into a pattern guard
@@ -460,6 +462,7 @@ E0748: include_str!("./error_codes/E0748.md"),
 //  E0188, // can not cast an immutable reference to a mutable pointer
 //  E0189, // deprecated: can only cast a boxed pointer to a boxed object
 //  E0190, // deprecated: can only cast a &-pointer to an &-object
+//  E0192, // negative impl only applicable to auto traits
 //  E0194, // merged into E0403
 //  E0196, // cannot determine a type for this closure
     E0208,
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.