]> git.proxmox.com Git - rustc.git/blob - compiler/rustc_error_codes/src/error_codes/E0641.md
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0641.md
1 Attempted to cast to/from a pointer with an unknown kind.
2
3 Erroneous code example:
4
5 ```compile_fail,E0641
6 let b = 0 as *const _; // error
7 ```
8
9 Type information must be provided if a pointer type being cast from/into another
10 type which 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 ```