-
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
Make place projections concrete. #60441
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
I thought this was because the MIR borrowck needs to replace the indexing values with an "abstract value" (i.e. treating |
I think that capability wound up not being used |
There's
and Line 2007 in 6cc24f2
But both of those only use ProjectionElem .
This seems fine, but |
@@ -1937,16 +1937,13 @@ impl_stable_hash_for!(struct Static<'tcx> { | |||
kind | |||
}); | |||
|
|||
/// The `Projection` data structure defines things of the form `B.x` | |||
/// or `*B` or `B[index]`. Note that it is parameterized because it is | |||
/// shared between `Constant` and `Place`. See the aliases |
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.
Oh, wow, this comment has been wrong for most of MIR's existence, I think?
For reasons, Projection<...>
isn't used by MIR borrowck, but ProjectionElem
is (as AbstractElem
).
I think that's why Projection
remained parameterized as well, but I'm not sure.
OK, so is there a concensus on this? If you'd like this to go in, then I'll run some tests and check for fallout.
Is there some reading material on this please. This is likely to influence what I'm doing in my fork ;) |
|
☔ The latest upstream changes (presumably #59897) made this pull request unmergeable. Please resolve the merge conflicts. |
Folks, before I go down the path of resolving those conflicts, do you want this change? |
Yes, sorry for not being clearer. This is an accidental leftover that everyone forgot about because of the |
18: Implement more TIR lowerings. r=ltratt a=vext01 This is a whole load more TIR lowerings. The TIR graphs are starting to look more complete, although there's still a lot more to do. I only stopped here because the changes are getting large, and more edits can come in later PRs. There's one part of this code (which I will point out), which i'm likely to change. It involves a type-parameterised MIR struct, which I think ultimately we will make concrete in TIR. However, I want to see the outcome of this upstream PR first: rust-lang/rust#60441 There's a ykpack change to accompany this: ykjit/yk#3 Co-authored-by: Edd Barrett <[email protected]>
18: Implement more TIR lowerings. r=ltratt a=vext01 This is a whole load more TIR lowerings. The TIR graphs are starting to look more complete, although there's still a lot more to do. I only stopped here because the changes are getting large, and more edits can come in later PRs. There's one part of this code (which I will point out), which i'm likely to change. It involves a type-parameterised MIR struct, which I think ultimately we will make concrete in TIR. However, I want to see the outcome of this upstream PR first: rust-lang/rust#60441 There's a ykpack change to accompany this: ykjit/yk#3 Co-authored-by: Edd Barrett <[email protected]>
synced. OK for me to squash? |
Oops, I missed this. Leave it with me. |
That last commit does the renaming. Quite a lot of churn. OK to squash? |
lgtm now, squashing would be good, yes |
☔ The latest upstream changes (presumably #60984) made this pull request unmergeable. Please resolve the merge conflicts. |
If everyone is OK with a4ba4fa, I'll squash. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Sorry, I screwed up the last commit. |
Once upon a time (commit 9bd35c0) there were two kinds of projection: one for places, and one for constants. It therefore made sense to share the `Projection` struct for both. Although the different use-cases used different concrete types, sharing was made possible by type-parameterisation of `Projection`. Since then, however, the usage of projections in constants has disappeared, meaning that (forgetting lifetimes for a moment) the parameterised type is only every instantiated under one guise. So it may as well be a concrete type.
1bbff00
to
123a456
Compare
Squashed. |
@bors r+ |
📌 Commit 123a456 has been approved by |
Make place projections concrete. **I'm not sure if we want this. I'm raising the PR for discussion** Whilst doing some work on our Rust fork, I noticed the following: Once upon a time (commit 9bd35c0) there were two kinds of projection: one for places, and one for constants. It therefore made sense to share the `Projection` struct for both. Although the different use-cases used different concrete types, sharing was made possible by type-parameterisation of `Projection`. Since then, however, the usage of projections in constants has disappeared, meaning that (forgetting lifetimes for a moment) the parameterised type is only every instantiated under one guise. So it may as well be a concrete type. Right? What do people think? This is entirely untested, although it does check. If we *don't* want this, then we should at least update the incorrect comment against `Projection`. Thanks
☀️ Test successful - checks-travis, status-appveyor |
I'm not sure if we want this. I'm raising the PR for discussion
Whilst doing some work on our Rust fork, I noticed the following:
Once upon a time (commit 9bd35c0) there were two kinds of
projection: one for places, and one for constants. It therefore made
sense to share the
Projection
struct for both. Although the differentuse-cases used different concrete types, sharing was made possible by
type-parameterisation of
Projection
.Since then, however, the usage of projections in constants has
disappeared, meaning that (forgetting lifetimes for a moment) the
parameterised type is only every instantiated under one guise. So it may
as well be a concrete type. Right?
What do people think? This is entirely untested, although it does check.
If we don't want this, then we should at least update the incorrect comment against
Projection
.Thanks