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 that can only be reproduced on playbot/play.rust-lang.org: casting a shared reference to a *const to a *mut _ (lack of type required) #25086

Closed
bstrie opened this issue May 4, 2015 · 3 comments

Comments

@bstrie
Copy link
Contributor

bstrie commented May 4, 2015

Test case, that mysteriously passes on my machine but fails on the playpen:

fn main() {
    &2 as *const i32 as *mut _;
}

Playpen output:

<anon>:2:5: 2:31 error: internal compiler error: cat_expr Errd
<anon>:2     &2 as *const i32 as *mut _;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
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 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:149


playpen: application terminated with error code 101
Program ended.

Local output:

ice.rs:2:5: 2:31 error: cannot determine a type for this expression: unconstrained type [E0101]
ice.rs:2     &2 as *const i32 as *mut _;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

Very strange...

@lilyball
Copy link
Contributor

lilyball commented May 4, 2015

Seems like a Beta vs Nightly difference. Switching to the nightly for playpen yields

<anon>:2:5: 2:31 error: cannot determine a type for this expression: unconstrained type [E0101]
<anon>:2     &2 as *const i32 as *mut _;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~

@pnkfelix
Copy link
Member

pnkfelix commented May 4, 2015

yeah this is probably one of the cases that was "resolved" by #24367 . ("Resolved" is in quotes because the team would prefer to fix the issues that lead us to call cat_expr when it might return Err.)

@pnkfelix pnkfelix closed this as completed May 4, 2015
@pnkfelix pnkfelix reopened this May 4, 2015
@pnkfelix
Copy link
Member

pnkfelix commented May 4, 2015

I closed this since the issue is resolved on nightly and the team had already decided not to backport the "fix" to the beta channel.

@pnkfelix pnkfelix closed this as completed May 4, 2015
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