about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-11-19 13:10:19 +0100
committerGitHub <noreply@github.com>2019-11-19 13:10:19 +0100
commitb5166b1e854ee07a3cf2cbd55b4658da10447fdc (patch)
tree56a7c31de0757789f4e3a2a613f5834e78448686 /src/librustc_error_codes/error_codes
parentee535a0f95f40513b130d7bcf0a2d77477b1b7b4 (diff)
parentdc137dd868daaa2d7821997e6a87d49fbb9e4ca8 (diff)
downloadrust-b5166b1e854ee07a3cf2cbd55b4658da10447fdc.tar.gz
rust-b5166b1e854ee07a3cf2cbd55b4658da10447fdc.zip
Rollup merge of #66461 - clemencetbk:master, r=GuillaumeGomez
Add explanation message for E0641

Part of #61137
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0641.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0641.md b/src/librustc_error_codes/error_codes/E0641.md
new file mode 100644
index 00000000000..e39bebce1fe
--- /dev/null
+++ b/src/librustc_error_codes/error_codes/E0641.md
@@ -0,0 +1,19 @@
+Attempted to cast to/from a pointer with an unknown kind.
+
+Erroneous code examples:
+
+```compile_fail,E0641
+let b = 0 as *const _; // error
+```
+
+Must give information for type of pointer that is being cast from/to if the
+type cannot be inferred.
+
+```
+// Creating a pointer from reference: type can be inferred
+let a = &(String::from("Hello world!")) as *const _; // Ok
+
+let b = 0 as *const i32; // Ok
+
+let c: *const i32 = 0 as *const _; // Ok
+```
\ No newline at end of file