File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 11Attempted to cast to/from a pointer with an unknown kind.
22
3- Erroneous code examples :
3+ Erroneous code example :
44
55``` compile_fail,E0641
66let b = 0 as *const _; // error
77```
88
9- Must give information for type of pointer that is being cast from/to if the
10- type cannot be inferred.
9+ Type information must be provided if a pointer type being cast from/into another
10+ type which cannot be inferred:
1111
1212```
1313// Creating a pointer from reference: type can be inferred
14- let a = &(String::from("Hello world!")) as *const _; // Ok
14+ let a = &(String::from("Hello world!")) as *const _; // ok!
1515
16- let b = 0 as *const i32; // Ok
16+ let b = 0 as *const i32; // ok!
1717
18- let c: *const i32 = 0 as *const _; // Ok
18+ let c: *const i32 = 0 as *const _; // ok!
1919```
You can’t perform that action at this time.
0 commit comments