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 casting to trait type twice #3689

Closed
ben0x539 opened this issue Oct 7, 2012 · 3 comments
Closed

Internal compiler error casting to trait type twice #3689

ben0x539 opened this issue Oct 7, 2012 · 3 comments
Labels
A-trait-system Area: Trait system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone

Comments

@ben0x539
Copy link
Contributor

ben0x539 commented Oct 7, 2012

I accidentally had something like stdout() as io::Writer and got an ICE, but it also happens with trivial traits/trait impls like this:

trait Foo {}
impl (): Foo {}

fn main() {
    let _a = () as Foo as Foo;
}

rustc just errors out with an unexpected failure, and says

rust: task failed at 'get_vtable: expected a static origin', /home/ben/code/repos/rust/src/rustc/middle/trans/meth.rs:507
@jbclements
Copy link
Contributor

Looks like I just ran into this too...

@catamorphism
Copy link
Contributor

Bumping to 0.7

@ben0x539
Copy link
Contributor Author

Can't reproduce this anymore. Maybe it went away when sigils started being required for object-boxing?

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
Previously, the `cast_lossless` lint would issue a warning on code that
converted a `usize` value to `f64`, on 32-bit targets.

`usize` to `f64` is a lossless cast on 32-bit targets, however there is
no corresponding `f64::from` that takes a `usize`, so `cast_lossless`'s
suggested replacement does not compile.

This PR disables the lint in the case of casting from `usize` or `isize`.

Fixes rust-lang#3689.

changelog: [`cast_lossless`] no longer gives wrong suggestion on usize->f64
xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
Fix `cast_lossless` to avoid warning on `usize` to `f64` conversion.

Previously, the `cast_lossless` lint would issue a warning on code that
converted a `usize` value to `f64`, on 32-bit targets.

`usize` to `f64` is a lossless cast on 32-bit targets, however there is
no corresponding `f64::from` that takes a `usize`, so `cast_lossless`'s
suggested replacement does not compile.

This PR disables the lint in the case of casting from `usize` or `isize`.

Fixes rust-lang#3689.

changelog: [`cast_lossless`] no longer gives wrong suggestion on usize,isize->f64
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jun 29, 2024
Fix ICE caused by seeking past `i64::MAX`

Make Miri behave the same as standard library on file seeking offset.

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

No branches or pull requests

3 participants