-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Impossible case reached: src/librustc_ty/needs_drop.rs:111 #72685
Comments
It seems like it might be this code rust/src/librustc_ty/needs_drop.rs Lines 101 to 116 in da57ced
@jonas-schievink do you think this might have been introduced in #70015? (Particularly given the comment https://github.com/rust-lang/rust/pull/70015/files#r392633710.) @Thomasdezeeuw could you try running the nightly from April 18th and tell us what the output is? |
Yeah, probably introduced there. Though the I'll take a look. I thought that only a |
@estebank April 18th compiler has the same problem:
April 17th:
|
Because of this: rust/src/librustc_mir/transform/generator.rs Lines 696 to 699 in 9cd3f1c
|
Ok, so this is a pre-existing bug, not introduced in the PR I linked. |
Sadly we need to account for TyErr everywhere where you fail if you expect something else. delay_span_bug is appropriate because an error will have been emitted already. |
…stebank Be more careful around ty::Error in generators cc rust-lang#72685 (doesn't close it because it's missing a reproduction to use as a test case) r? @estebank
…stebank Be more careful around ty::Error in generators cc rust-lang#72685 (doesn't close it because it's missing a reproduction to use as a test case) r? @estebank
…stebank Be more careful around ty::Error in generators cc rust-lang#72685 (doesn't close it because it's missing a reproduction to use as a test case) r? @estebank
…stebank Be more careful around ty::Error in generators cc rust-lang#72685 (doesn't close it because it's missing a reproduction to use as a test case) r? @estebank
…stebank Be more careful around ty::Error in generators cc rust-lang#72685 (doesn't close it because it's missing a reproduction to use as a test case) r? @estebank
@Thomasdezeeuw can you check this again on a current nightly? It should be fixed. |
@jonas-schievink Not sure if its the same problem but I got another impossible case:
Rust version: |
Thanks, opened #73339 to try to fix this one too. |
Don't run generator transform when there's a TyErr Not sure if this might cause any problems later on, but we shouldn't be hitting codegen or const eval for the produced MIR anyways, so it should be fine. cc rust-lang#72685 (comment)
Don't run generator transform when there's a TyErr Not sure if this might cause any problems later on, but we shouldn't be hitting codegen or const eval for the produced MIR anyways, so it should be fine. cc rust-lang#72685 (comment)
Don't run generator transform when there's a TyErr Not sure if this might cause any problems later on, but we shouldn't be hitting codegen or const eval for the produced MIR anyways, so it should be fine. cc rust-lang#72685 (comment)
Don't run generator transform when there's a TyErr Not sure if this might cause any problems later on, but we shouldn't be hitting codegen or const eval for the produced MIR anyways, so it should be fine. cc rust-lang#72685 (comment)
@Thomasdezeeuw Now that #73339 has landed, could you check this again? |
@jonas-schievink The compiler now outputs a bit more information, but still panics. However I think I have a reproducer now: fn main() {
println!("Hello, world!");
}
const FN_PTR: fn(_, _) -> _ = my_fn as fn(_, _) -> _;
async fn my_fn(_a: usize, _b: usize) -> Result<(), ()> {
Ok(())
} Note that I'm not 100% this triggered the original ICEs, but this at least triggers the following one:
|
Is the task of this issue addition of a regression test? If so, I'll try it. I found a simpler reproducer. pub const FOO: fn() -> _ = 1;
fn main() {} 1.46.0 Output
Current stable (1.49.0) Output
|
@rustbot claim |
Yes. |
Considering #81509 is merged, I think this can be closed. |
I can't share the code, but I have a commit at which problem surfaced in case I need to check it again.
With rustc 1.45.0-nightly (664fcd3 2020-05-27):
The text was updated successfully, but these errors were encountered: