]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0641.md
Rollup merge of #67943 - Stromberg90:patch-1, r=jonas-schievink
[rust.git] / src / librustc_error_codes / error_codes / E0641.md
1 Attempted to cast to/from a pointer with an unknown kind.
2
3 Erroneous code examples:
4
5 ```compile_fail,E0641
6 let b = 0 as *const _; // error
7 ```
8
9 Must give information for type of pointer that is being cast from/to if the
10 type cannot be inferred.
11
12 ```
13 // Creating a pointer from reference: type can be inferred
14 let a = &(String::from("Hello world!")) as *const _; // Ok
15
16 let b = 0 as *const i32; // Ok
17
18 let c: *const i32 = 0 as *const _; // Ok
19 ```