summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0200.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0200.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0200.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0200.md b/compiler/rustc_error_codes/src/error_codes/E0200.md
new file mode 100644
index 000000000..7245bb59c
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0200.md
@@ -0,0 +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.
+
+```
+struct Foo;
+
+unsafe trait Bar { }
+
+unsafe impl Bar for Foo { } // ok!
+```