File tree 1 file changed +6
-6
lines changed
src/librustc_error_codes/error_codes
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
Attempted to cast to/from a pointer with an unknown kind.
2
2
3
- Erroneous code examples :
3
+ Erroneous code example :
4
4
5
5
``` compile_fail,E0641
6
6
let b = 0 as *const _; // error
7
7
```
8
8
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:
11
11
12
12
```
13
13
// 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!
15
15
16
- let b = 0 as *const i32; // Ok
16
+ let b = 0 as *const i32; // ok!
17
17
18
- let c: *const i32 = 0 as *const _; // Ok
18
+ let c: *const i32 = 0 as *const _; // ok!
19
19
```
You can’t perform that action at this time.
0 commit comments