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

Compiler panic while compiling #28540

Closed
ghost opened this issue Sep 20, 2015 · 8 comments
Closed

Compiler panic while compiling #28540

ghost opened this issue Sep 20, 2015 · 8 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ghost
Copy link

ghost commented Sep 20, 2015

Compiler paniced when "cargo test" was executed

git snap shot of file https://github.com/valarauca/Fact/tree/1cfcdbb41e2099abefcea7994bd03b48aa2be882

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 20, 2015
@steveklabnik
Copy link
Member

Can you give some more information please? This builds and runs just fine for me. I'm on Linux, using both 1.3 stable and the nightly from 9-17.

@ghost
Copy link
Author

ghost commented Sep 21, 2015

I just filed a bug because the compiler told me too.

If you can't re-produce then I really have no clue. I wasn't driving deep into debugging it.

@steveklabnik
Copy link
Member

I just mean like, platform and compiler version? Maybe it only happens in OSX and not Linux, or in a different version than I tried.

@ghost
Copy link
Author

ghost commented Sep 21, 2015

Sorry shouldn't post online before morning coffee

I used the default x64 binaries v1.3 for Linux

My kernel is v3.9.3

Laptop is at home, so I can answer additional questions in ~8-9 hours

On 9/21/15, Steve Klabnik notifications@github.com wrote:

I just mean like, platform and compiler version? Maybe it only happens in
OSX and not Linux, or in a different version than I tried.


Reply to this email directly or view it on GitHub:
#28540 (comment)

@steveklabnik
Copy link
Member

Ah ha! I also noticed just now that you linked to a specific commit, which wasn't HEAD, so I bet that was why I missed it before :( using that commit, both 1.3 and 1.5-nightly case an ICE.

@ghost
Copy link
Author

ghost commented Sep 21, 2015

It's likely worth filing as a separate bug (I'm honestly not sure). But if you get brave enough to read that 100LOC match statement that's returning a Boxed lambda. There is a statement like

        SearchOp::RsQiFn( r, q, f )
            => Box::new( move | var :&LLFact | -> bool
            {
                true
                &&
                match var.forward
                {
                    DataPoint::None => true,
                    _ => false
                }
                &&
                match var.reverse
                {
                    DataPoint::Key( k ) => k == r,
                    _ => false
                }
            }),

Where part of the evaluation is

       true && match stuff /* yadayada*/

This is because simply preforming this operation:

  match item0 { something => true, _ => false } && match item1{ something => true, _ => false }

Won't preform the proper type inference within the lambda. Instead it'll throw an error concerning my attempting to passing a &&match to a bool result.

@arielb1
Copy link
Contributor

arielb1 commented Sep 21, 2015

@valarauca

The second problem is that your code is parsed as a match statement followed by twice taking the address of a match expression - as if a semicolon was inserted between them:

        SearchOp::RsQiFn( r, q, f )
            => Box::new( move | var :&LLFact | -> bool
            {
                match var.forward
                {
                    DataPoint::None => true,
                    _ => false
                }; // <- note implicit semicolon
                & & match var.reverse
                {
                    DataPoint::Key( k ) => k == r,
                    _ => false
                }
            }),

You can put both expressions within parentheses to prevent this. Not a bug, anyway.

Could you post the ICE backtrace?

@steveklabnik
Copy link
Member

Giving this a close, as the author has gone, and we don't have enough info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants