-
Notifications
You must be signed in to change notification settings - Fork 13.3k
internal compiler error: type_of with ty_param #10954
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
Labels
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
Same error. Remove |
Edit: Same thing with Edit: Replacing "C" by "Rust" produces: internal compiler error: unimplemented Foreign functions with Rust ABI |
The following fails with the extern "C" fn foo<T>(_: T) {}
fn main() {} |
Closed by 8f3f666, foreign functions can't have type parameters right now |
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Jun 30, 2023
[`derivable_impls`]: don't lint if `default()` call expr unsize-coerces to trait object Fixes rust-lang#10158. This fixes a FP where the derive-generated Default impl would have different behavior because of unsize coercion from `Box<T>` to `Box<dyn Trait>`: ```rs struct S { x: Box<dyn std::fmt::Debug> } impl Default for S { fn default() -> Self { Self { x: Box::<()>::default() // ^~ Box<()> coerces to Box<dyn Debug> // #[derive(Default)] would call Box::<dyn Debug>::default() } } } ``` (this intentionally only looks for trait objects `dyn` specifically, and not any unsize coercion, e.g. `&[i32; 5]` to `&[i32]`, because that breaks existing tests and isn't actually problematic, as far as I can tell) changelog: [`derivable_impls`]: don't lint if `default()` call expression unsize-coerces to trait object
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There was an old closed bug with this title, I've opened a new issue rather than reopening that one.
Compiling this file exhibits the bug (received from IRC, not minimized yet):
Compiler output:
The text was updated successfully, but these errors were encountered: