-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: Fix layout for hir_ty::Ty
and friends
#14802
Conversation
struct St2; | ||
|
||
impl Tr for St2 { | ||
type Ty = i64; | ||
} | ||
|
||
struct Goal(St<St2>); | ||
|
||
let x = Goal(St(5)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is strange for me that we support this. We don't pass a trait env with block anywhere in the layout code, but we can find the layout of Goal
here. Anyway, I added this test to keep this behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The layout code receives the substitutions though, which would come from the type inference code which does account for blocks.
// if we move `St2` out of body, the test will fail, as we don't see the impl anymore. That | ||
// case will probably be rejected by rustc in some later edition, but we should support this | ||
// case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean only moving out the St2
struct definition (leaving the impl for St2
in the block)? That's surprising that that does not work. I'm pretty sure it should ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I mean keeping the impl inside of the block. You can reproduce that by hovering on goal. I guess the problem is that we don't pass the block of the goal, only the crate, so it can't normalize the associated type. But with this logic, this one shouldn't work either...
@bors r+ |
@bors r- |
@bors r+ |
@bors retry |
@bors r- |
@bors r- |
@bors r=SomeString |
It's broken in most places, rust-lang/homu#191. |
Fix layout for `hir_ty::Ty` and friends
💔 Test failed - checks-actions |
Fix layout for `hir_ty::Ty` and friends
@bors r- |
💔 Test failed - checks-actions |
@bors r+ |
☀️ Test successful - checks-actions |
hir_ty::Ty
and friendshir_ty::Ty
and friends
No description provided.