File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 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"),
351351E0636 : include_str!( "./error_codes/E0636.md" ) ,
352352E0638 : include_str!( "./error_codes/E0638.md" ) ,
353353E0639 : include_str!( "./error_codes/E0639.md" ) ,
354+ E0641 : include_str!( "./error_codes/E0641.md" ) ,
354355E0642 : include_str!( "./error_codes/E0642.md" ) ,
355356E0643 : include_str!( "./error_codes/E0643.md" ) ,
356357E0644 : include_str!( "./error_codes/E0644.md" ) ,
@@ -585,7 +586,6 @@ E0744: include_str!("./error_codes/E0744.md"),
585586 E0634 , // type has conflicting packed representaton hints
586587 E0637 , // "'_" is not a valid lifetime bound
587588 E0640 , // infer outlives requirements
588- E0641 , // cannot cast to/from a pointer with an unknown kind
589589// E0645, // trait aliases not finished
590590 E0657 , // `impl Trait` can only capture lifetimes bound at the fn level
591591 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