forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#72948 - Dylan-DPC:rollup-fazhw00, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#72586 (split select into submodules) - rust-lang#72900 (Don't count pathless --extern for unused-crate-dependencies warnings) - rust-lang#72924 (Stabilize `std::io::Buf{Reader, Writer}::capacity`) - rust-lang#72942 (clean up E0641 explanation) - rust-lang#72945 (Updated documentation for Control Flow Guard) Failed merges: r? @ghost
- Loading branch information
Showing
8 changed files
with
1,497 additions
and
1,432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
Attempted to cast to/from a pointer with an unknown kind. | ||
|
||
Erroneous code examples: | ||
Erroneous code example: | ||
|
||
```compile_fail,E0641 | ||
let b = 0 as *const _; // error | ||
``` | ||
|
||
Must give information for type of pointer that is being cast from/to if the | ||
type cannot be inferred. | ||
Type information must be provided if a pointer type being cast from/into another | ||
type which cannot be inferred: | ||
|
||
``` | ||
// Creating a pointer from reference: type can be inferred | ||
let a = &(String::from("Hello world!")) as *const _; // Ok | ||
let a = &(String::from("Hello world!")) as *const _; // ok! | ||
let b = 0 as *const i32; // Ok | ||
let b = 0 as *const i32; // ok! | ||
let c: *const i32 = 0 as *const _; // Ok | ||
let c: *const i32 = 0 as *const _; // ok! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.