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

Remove enum -> float casts #14794

Closed
brson opened this issue Jun 10, 2014 · 3 comments · Fixed by #14874
Closed

Remove enum -> float casts #14794

brson opened this issue Jun 10, 2014 · 3 comments · Fixed by #14874
Milestone

Comments

@brson
Copy link
Contributor

brson commented Jun 10, 2014

Fixed in #14786, but this feature is silly. I don't at all care that somebody that wants to cast an enum to a float must first cast to an int.

Nominating.

@emberian
Copy link
Member

+1

@pnkfelix
Copy link
Member

Assigning P-backcompat-lang, 1.0.

@pnkfelix pnkfelix added this to the 1.0 milestone Jun 12, 2014
@alexcrichton
Copy link
Member

Note that casting to other scalars, like pointers, currently ICEs

enum A {
    B,
    C,
}

fn main() {
    B as *int;
}
error: internal compiler error: translating unsupported cast: A (cast_enum) -> *int (cast_pointer)
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:162


pcwalton added a commit to pcwalton/rust that referenced this issue Jun 13, 2014
Closes rust-lang#14794.

If you're casting from an enum to a float, cast through an integer
first.

[breaking-change]
bors added a commit that referenced this issue Jun 14, 2014
…=alexcrichton

Closes #14794.

If you're casting from an enum to a float, cast through an integer
first.

[breaking-change]

r? @alexcrichton
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
Restructure InlayHint, no longer derive properties from its kind

Closes rust-lang/rust-analyzer#14595
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

Successfully merging a pull request may close this issue.

4 participants