Skip to content

ICE while translating unsupported cast #17480

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

Closed
ghost opened this issue Sep 23, 2014 · 6 comments
Closed

ICE while translating unsupported cast #17480

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

Comments

@ghost
Copy link

ghost commented Sep 23, 2014

fn main() {
   enum Foo { F1 }
   let foo : *const Foo = F1 as *const Foo;
}
 $ rustc foo.rs 
foo.rs:4:9: 4:12 warning: unused variable: `foo`, #[warn(unused_variable)] on by default
foo.rs:4     let foo : *const Foo = F1 as *const Foo;
                 ^~~
error: internal compiler error: translating unsupported cast: main::Foo (cast_enum) -> *const main::Foo (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>', /var/tmp/portage/dev-lang/rust-9999-r2/work/rust-9999/src/libsyntax/diagnostic.rs:169

rust version: 1fb838d99

@mahkoh
Copy link
Contributor

mahkoh commented Sep 23, 2014

Not quite a dupe but related to #17458.

@mahkoh
Copy link
Contributor

mahkoh commented Sep 23, 2014

Actually this is #17444

@ghost
Copy link
Author

ghost commented Sep 23, 2014

But in #17444 bug is in:
libsyntax/ast_util.rs:776
while here it's in:
libsyntax/diagnostic.rs:169
I'm not sure they're the same

Yeah, they're the same

@mahkoh
Copy link
Contributor

mahkoh commented Sep 23, 2014

Both fail to compile here.

@ghost ghost added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 3, 2014
@bkoropoff
Copy link
Contributor

This bug is a dupe of #17444 and can be closed

@alexcrichton
Copy link
Member

Thanks @bkoropoff!

lnicola pushed a commit to lnicola/rust that referenced this issue Jul 11, 2024
fix: pattern completions in let-stmt

fix rust-lang#17480.

We can write `let S { a, b } = s;` or `let Some(x) = a else {}`, so it is reasonable to allow pattern completions in `LetStmt`.
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

3 participants