File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,7 @@ E0635: include_str!("./error_codes/E0635.md"),
351
351
E0636 : include_str!( "./error_codes/E0636.md" ) ,
352
352
E0638 : include_str!( "./error_codes/E0638.md" ) ,
353
353
E0639 : include_str!( "./error_codes/E0639.md" ) ,
354
+ E0641 : include_str!( "./error_codes/E0641.md" ) ,
354
355
E0642 : include_str!( "./error_codes/E0642.md" ) ,
355
356
E0643 : include_str!( "./error_codes/E0643.md" ) ,
356
357
E0644 : include_str!( "./error_codes/E0644.md" ) ,
@@ -585,7 +586,6 @@ E0744: include_str!("./error_codes/E0744.md"),
585
586
E0634 , // type has conflicting packed representaton hints
586
587
E0637 , // "'_" is not a valid lifetime bound
587
588
E0640 , // infer outlives requirements
588
- E0641 , // cannot cast to/from a pointer with an unknown kind
589
589
// E0645, // trait aliases not finished
590
590
E0657 , // `impl Trait` can only capture lifetimes bound at the fn level
591
591
E0667 , // `impl Trait` in projections
Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments