about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-01-18 19:36:05 +0100
committerGitHub <noreply@github.com>2020-01-18 19:36:05 +0100
commit2a12ef81341cfbba852cc3145c6398841607c185 (patch)
treeef7cf0c2716f079f444793d713066572e2fb83a6
parent36e58ea6bf7aa104bad78f5e291d53887678c283 (diff)
parent9746b05da995629780f559e68cde2a3d41b3b2bc (diff)
downloadrust-2a12ef81341cfbba852cc3145c6398841607c185.tar.gz
rust-2a12ef81341cfbba852cc3145c6398841607c185.zip
Rollup merge of #68340 - GuillaumeGomez:clean-up-e0200, r=Dylan-DPC
clean up e0200 explanation

r? @Dylan-DPC
-rw-r--r--src/librustc_error_codes/error_codes/E0200.md19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/librustc_error_codes/error_codes/E0200.md b/src/librustc_error_codes/error_codes/E0200.md
index 865e91430ac..7245bb59ce5 100644
--- a/src/librustc_error_codes/error_codes/E0200.md
+++ b/src/librustc_error_codes/error_codes/E0200.md
@@ -1,14 +1,23 @@
+An unsafe trait was implemented without an unsafe implementation.
+
+Erroneous code example:
+
+```compile_fail,E0200
+struct Foo;
+
+unsafe trait Bar { }
+
+impl Bar for Foo { } // error!
+```
+
 Unsafe traits must have unsafe implementations. This error occurs when an
 implementation for an unsafe trait isn't marked as unsafe. This may be resolved
 by marking the unsafe implementation as unsafe.
 
-```compile_fail,E0200
+```
 struct Foo;
 
 unsafe trait Bar { }
 
-// this won't compile because Bar is unsafe and impl isn't unsafe
-impl Bar for Foo { }
-// this will compile
-unsafe impl Bar for Foo { }
+unsafe impl Bar for Foo { } // ok!
 ```