Skip to content

ICE with deep DST coercion #19404

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Kimundi opened this issue Nov 29, 2014 · 5 comments · Fixed by #27147
Closed

ICE with deep DST coercion #19404

Kimundi opened this issue Nov 29, 2014 · 5 comments · Fixed by #27147
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Kimundi
Copy link
Member

Kimundi commented Nov 29, 2014

Error:

figment_sketch.rs:1:1: 1:1 error: internal compiler error: Encountered errors `[FulfillmentError(Obligation(trait_ref=<_ : core::kinds::Sized>,depth=1),Unimplemented)]` fulfilling `<*mut alloc::rc::RcBox<Component+'static> : core::ptr::RawPtr<alloc::rc::RcBox<Component+'static>>>` during trans
figment_sketch.rs:1 use std::intrinsics::TypeId;
                    ^

Reproduces with:

use std::intrinsics::TypeId;
use std::rc::Rc;

type Fp<T> = Rc<T>;

struct Engine;

trait Component: 'static {}
impl Component for Engine {}

trait Env {
    fn get_component_type_id(&self, type_id: TypeId) -> Option<Fp<Component>>;
}

impl<'a> Env+'a {
    fn get_component<T: Component>(&self) -> Option<Fp<T>> {
        // This line is needed to cause the error:
        let x = self.get_component_type_id(TypeId::of::<T>());
        None
    }
}

trait Figment {
    fn init(&mut self, env: &Env);
}


struct MyFigment;

impl Figment for MyFigment {
    fn init(&mut self, env: &Env) {
        let engine = env.get_component::<Engine>();
    }
}

fn main() {

}
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 29, 2014
@Kimundi Kimundi changed the title ICE with DST ICE with deep DST coercion Nov 30, 2014
@Kimundi
Copy link
Member Author

Kimundi commented Nov 30, 2014

cc @nick29581

@Kimundi
Copy link
Member Author

Kimundi commented Nov 30, 2014

I just now noticed that Rc<T> does not actually yet allow unsized T. Might be related.

@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

This doesn't compile, but it doesn't ICE.

@alexcrichton alexcrichton added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 21, 2015
@frewsxcv
Copy link
Member

It looks like std::intrinsics::TypeId; no longer exists. Did it get replaced by something else? I imagine there's not much value in adding a regression test with a broken import

@tamird
Copy link
Contributor

tamird commented Jun 18, 2015

from 70f7165:

TypeId is now defined at std::any::TypeId

steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 21, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 21, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 21, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 22, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 22, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 22, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 22, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants