Skip to content
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 polymorphic struct without <T> with destructor #3214

Closed
bblum opened this issue Aug 17, 2012 · 3 comments
Closed

ICE with polymorphic struct without <T> with destructor #3214

bblum opened this issue Aug 17, 2012 · 3 comments
Labels
A-resolve Area: Name resolution I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone

Comments

@bblum
Copy link
Contributor

bblum commented Aug 17, 2012

fn foo<T>() {
    struct foo {
        mut x: T;
        drop { }
    }
}
fn main() { }

prints error: internal compiler error: type_of with ty_param

The workaround for this is easy - just write foo<T> to "thread the type variable through", as it were. I'm not sure if this should be permitted or error.

Backtrace:

#3  0x00007ffff5a03913 in driver::session::__extensions__::meth5509::bug ()
#4  0x00007ffff5a1311a in middle::trans::type_of::type_of ()
#5  0x00007ffff5a22abb in middle::trans::type_of::type_of::anon ()
#6  0x00007ffff5a229e5 in vec::map5905 ()
#7  0x00007ffff5a135d1 in middle::trans::type_of::type_of ()
#8  0x00007ffff5a71a43 in middle::trans::base::trans_class_dtor ()
#9  0x00007ffff5aa9eb1 in middle::trans::base::trans_struct_def ()
#10 0x00007ffff5a76b34 in middle::trans::base::trans_item ()
#11 0x00007ffff5a775c2 in middle::trans::base::trans_item ()
#12 0x00007ffff5ac884c in middle::trans::base::trans_crate ()
@ghost ghost assigned catamorphism Aug 18, 2012
@catamorphism
Copy link
Contributor

Nested items (including structs) shouldn't be allowed to capture ty params, so the bug is that the typechecker should be rejecting this.

@nikomatsakis
Copy link
Contributor

Correction: resolve ought to be rejecting it.

@catamorphism
Copy link
Contributor

Reproduced as of a477c5a

RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 17, 2023
Move some x86 intrinsics code to helper functions in `shims::x86`

To make them reusable for intrinsics of other x86 features.

Splitted from rust-lang/miri#3192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants