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

Regression in type inference of casting in constants #28801

Closed
jethrogb opened this Issue Oct 1, 2015 · 6 comments

Comments

Projects
None yet
4 participants
@jethrogb
Copy link
Contributor

jethrogb commented Oct 1, 2015

This works in stable, beta and nightly:

let x: *mut () = (0 as *const usize) as *const _ as *mut _;

This only works in stable:

const x: *mut () = (0 as *const usize) as *const _ as *mut _;

But in beta and nightly results in:

<anon>:2:47: 2:55 error: unable to infer enough type information about `_`; type annotations or generic parameter binding required [E0282]
<anon>:2     const x: *mut () = (0 as *const usize) as *const _ as *mut _;

@jethrogb jethrogb changed the title Regression in type inference of constants Regression in type inference of casting in constants Oct 1, 2015

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Oct 2, 2015

triage: I-nominated

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Oct 5, 2015

This compiles with rustc 1.5.0-nightly (168a23ebe 2015-10-01) and 1.3.0, but not 1.4.0 Should we bisect?

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Oct 5, 2015

This looks to be fixed by #28131. Should I beta-nominate that?

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Oct 5, 2015

@arielb1 yeah I'll beta-nominate that, thanks for the investigation!

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Oct 5, 2015

Also removing I-nominated as this should be dealt with by the beta-nomination

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Oct 5, 2015

Thanks for the report again @jethrogb! I'm gonna close this in favor of the beta nomination over at #28131 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.