Skip to content

Commit 77a74ec

Browse files
authored
Rollup merge of #72942 - GuillaumeGomez:cleanup-e0641, r=Dylan-DPC
clean up E0641 explanation r? @Dylan-DPC
2 parents ec2826c + 64b5520 commit 77a74ec

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 numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Attempted to cast to/from a pointer with an unknown kind.
22

3-
Erroneous code examples:
3+
Erroneous code example:
44

55
```compile_fail,E0641
66
let 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
```

0 commit comments

Comments
 (0)