forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#119343 - matthiaskrgr:rollup-vkt8lst, r=matth…
…iaskrgr Rollup of 2 pull requests Successful merges: - rust-lang#119175 (fix: diagnostic for casting reference to slice) - rust-lang#119337 (Remove dead codes) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
7 changed files
with
47 additions
and
49 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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
fn main() { | ||
"example".as_bytes() as [char]; | ||
//~^ ERROR cast to unsized type | ||
|
||
let arr: &[u8] = &[0, 2, 3]; | ||
arr as [char]; | ||
//~^ ERROR cast to unsized type | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0620]: cast to unsized type: `&[u8]` as `[char]` | ||
--> $DIR/cast-to-slice.rs:2:5 | ||
| | ||
LL | "example".as_bytes() as [char]; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^------ | ||
| | | ||
| help: try casting to a reference instead: `&[char]` | ||
|
||
error[E0620]: cast to unsized type: `&[u8]` as `[char]` | ||
--> $DIR/cast-to-slice.rs:6:5 | ||
| | ||
LL | arr as [char]; | ||
| ^^^^^^^------ | ||
| | | ||
| help: try casting to a reference instead: `&[char]` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0620`. |
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