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

Internal Compiler Error #30536

Closed
vsupalov opened this issue Dec 23, 2015 · 3 comments
Closed

Internal Compiler Error #30536

vsupalov opened this issue Dec 23, 2015 · 3 comments

Comments

@vsupalov
Copy link

Compiler panics and tells me to report the bug.

I tried this code:

use chrono::DateTime;
use chrono::UTC;

extern crate chrono;

enum TagType {
    Path(Path),
    //http://doc.rust-lang.org/nightly/std/string/struct.String.html
    String(String),
    //std::fs uses time_t
    //https://doc.rust-lang.org/beta/std/fs/struct.Metadata.html
    Date(DateTime<UTC>),
}

struct Tag {
    name: String,
    data: Box<TagType>,
}

impl Tag {
    pub fn new(name: String, data: Box<TagType>) -> Tag {
        Tag {
            name: name,
            data: data,
        }
    }
}

fn main() {
}

I expected to see this happen: the code compiling.

Instead, this happened: a compiler panic

Meta

rustc --version --verbose:
rustc 1.5.0 (3d7cd77 2015-12-04)
binary: rustc
commit-hash: 3d7cd77
commit-date: 2015-12-04
host: x86_64-unknown-linux-gnu
release: 1.5.0

Backtrace:

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Unexpected type returned from struct_tail: TagType for ty=TagType', ../src/librustc_trans/trans/type_of.rs:385

Could not compile `imgtag`.
@mitaa
Copy link
Contributor

mitaa commented Dec 23, 2015

I'm guessing Path is std::path::Path?

Then, I think, this should be a dup of #16812

@vsupalov
Copy link
Author

Yes. I failed to copy the line for this one, sorry. Removing the path fixes the problem.

@apasel422
Copy link
Contributor

Closing as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants