Skip to content

Conversation

ouz-a
Copy link
Contributor

@ouz-a ouz-a commented May 31, 2022

This avoids ICE on issue #97381 I think the bug is a bit deeper though, it compiles fine when v is &v which makes me think Deref is causing some issue with borrowck but it's fine I guess since this thing crashes since nightly-2020-09-17 😅

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 31, 2022
@rust-highfive
Copy link
Contributor

r? @nagisa

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 31, 2022
@compiler-errors
Copy link
Member

compiler-errors commented May 31, 2022

Does this fix #97491? It might actually turn that into a different ICE with the delayed bug. Maybe we should turn this into a hard error?

@ouz-a
Copy link
Contributor Author

ouz-a commented May 31, 2022

Does this fix #97491? It might actually turn that into a different ICE with the delayed bug. Maybe we should turn this into a hard error?

You are right it turns it into different ICE, this motivated me so I am going to take another shot at solving this if I can't I will make it return a hard error.

@compiler-errors
Copy link
Member

Thanks!

@ouz-a
Copy link
Contributor Author

ouz-a commented May 31, 2022

I think this just fixes #97491 as well now.

@compiler-errors
Copy link
Member

@ouz-a Do you mind adding a test if this does fix #97491? I am curious what the behavior is -- compile fail, or compile pass?

@@ -0,0 +1,19 @@
// run-pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is OK with just build-pass, also can you rustfmt this file?

Copy link
Member

@compiler-errors compiler-errors Jun 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have extra time, I would also be interested in adding a revision (or copy of this test) that tries to use the code, like trying to subtract two dyn Vector2 types. I want to ensure that the code fails to compile.

@nagisa
Copy link
Member

nagisa commented Jun 5, 2022

r? @compiler-errors


One piece of feedback I have is that this will want commits to be squashed and reworded to something more meaningful before landing.

@ouz-a
Copy link
Contributor Author

ouz-a commented Jun 5, 2022

r? @compiler-errors

One piece of feedback I have is that this will want commits to be squashed and reworded to something more meaningful before landing.

squashed and reworded hope it makes more sense now.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 8, 2022

📌 Commit 8f1fff0 has been approved by compiler-errors

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 8, 2022
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jun 8, 2022
Remove unwrap from get_vtable

This avoids ICE on issue rust-lang#97381 I think the bug is a bit deeper though, it compiles fine when `v` is `&v` which makes me think `Deref` is causing some issue with borrowck but it's fine I guess since this thing crashes since `nightly-2020-09-17` 😅
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 8, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#97595 (Remove unwrap from get_vtable)
 - rust-lang#97597 (Preserve unused pointer to address casts)
 - rust-lang#97819 (Recover `import` instead of `use` in item)
 - rust-lang#97823 (Recover missing comma after match arm)
 - rust-lang#97851 (Use repr(C) when depending on struct layout in ptr tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 148a44a into rust-lang:master Jun 8, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 8, 2022
@ouz-a ouz-a deleted the issue-97381 branch June 28, 2022 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants