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.
Rollup merge of rust-lang#108790 - cjgillot:mono-cast, r=oli-obk
Do not ICE when interpreting a cast between non-monomorphic types Fixes rust-lang#101596
- Loading branch information
Showing
2 changed files
with
37 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Check that the interpreter does not ICE when trying to unsize `B` to `[u8]`. | ||
// This is a `build` test to ensure that const-prop-lint runs. | ||
// build-pass | ||
|
||
#![feature(unsize)] | ||
|
||
fn foo<B>(buffer: &mut [B; 2]) | ||
where B: std::marker::Unsize<[u8]>, | ||
{ | ||
let buffer: &[u8] = &buffer[0]; | ||
} | ||
|
||
fn main() { | ||
foo(&mut [[0], [5]]); | ||
} |