-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: translating unsupported cast: *const str (cast_other) -> *const u8 (cast_pointer) #19424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Duplicate of #18396 |
Another case was reported in #18396 which is basically the same example: fn main() {
let foo: &mut [u8] = &mut [1,2,3];
foo as *mut [u8] as *mut u8;
}
|
Possible duplicate of #15355 |
Another one, probably also invalid code. It rusn on a nightly of last week or so. pub trait Trait{ static mut staticvar:*mut u8=0 as *mut u8; pub fn func(env:&mut Trait){
} pub fn main(){} stack backtrace: */ $ rustc --version |
No longer ICEs. $ rustc main.rs
main.rs:3:15: 3:46 error: illegal cast; cast from fat pointer: `*const str` as `*const u8`
main.rs:3 let ptr = string as *const _ as *const u8;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error |
The code is probably invalid, but still generates an ICE.
The code is very short:
Backtrace:
Version info:
Happens also in:
The text was updated successfully, but these errors were encountered: