-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE with unsizing an extern type #79409
Comments
It seems clear to me that this shouldn't compile: there's no way to determine, even at run time, how many bytes of storage But this presents a pretty big problem: unsized locals of #![feature(extern_types)]
#![feature(unsized_locals)]
extern {
type Foo;
}
fn mk_foo() -> Box<Foo> {
unimplemented!()
}
fn unsized_local_generic_parameter<T: ?Sized>(x: Box<T>) {
// `unsized_locals` allows you to create locals of generic `?Sized`
// parameter types
let _x = *x;
}
fn main() {
// But `extern_types` allows you to create pointers to extern types, and
// pass them to functions expecting a pointer to a `?Sized` parameter type
unsized_local_generic_parameter(mk_foo());
} It seems to me that these features can't coexist as they are currently - I think this needs discussion from the lang team. |
Triage: Still reproduces in Playground on current nightly, now at |
|
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: