-
Notifications
You must be signed in to change notification settings - Fork 545
Clean up skolemization with placeholder #217
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
Conversation
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.
Thanks! Overall, looks good :)
One thing is that "placeholder" seems a bit weird when used as a verb. I would propose "placeholder-ify", "placeholdered", and "placeholdering". I left comments where I think we might want to change.
Also, I left a couple of nits/typos/minor comments.
src/traits/hrtb.md
Outdated
@@ -36,20 +36,20 @@ to the subtyping for higher-ranked types (which is described [here][hrsubtype] | |||
and also in a [paper by SPJ]. If you wish to understand higher-ranked | |||
subtyping, we recommend you read the paper). There are a few parts: | |||
|
|||
**TODO**: We should define _skolemize_. | |||
**TODO**: We should define _placeholder_. |
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.
I think we can remove this TODO and just link to the glossary?
src/traits/hrtb.md
Outdated
@@ -78,7 +78,7 @@ impl Foo<&'static isize> for StaticInt; | |||
|
|||
We want the obligation `StaticInt : for<'a> Foo<&'a isize>` to be | |||
considered unsatisfied. The check begins just as before. `'a` is | |||
skolemized to `'0` and the impl trait reference is instantiated to | |||
placeholder to `'0` and the impl trait reference is instantiated to |
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.
verb?
src/borrow_check/region_inference.md
Outdated
corresponds (intuitively) to some unknown set of other elements – | ||
for details on skolemization, see the section | ||
[skolemization and universes](#skol). | ||
for details on placeholder, see the section |
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.
for details on placeholder, see the section | |
for details on placeholders, see the section |
src/borrow_check/region_inference.md
Outdated
for details on skolemization, see the section | ||
[skolemization and universes](#skol). | ||
for details on placeholder, see the section | ||
[placeholder and universes](#placeholder). |
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.
[placeholder and universes](#placeholder). | |
[placeholders and universes](#placeholder). |
src/borrow_check/region_inference.md
Outdated
@@ -198,7 +198,7 @@ fn bar<'a, T>(t: &'a T) { | |||
``` | |||
|
|||
Here, the name `'b` is not part of the root universe. Instead, when we | |||
"enter" into this `for<'b>` (e.g., by skolemizing it), we will create | |||
"enter" into this `for<'b>` (e.g., by placeholder it), we will create |
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.
verb?
src/borrow_check/region_inference.md
Outdated
@@ -411,7 +411,7 @@ for<'a> fn(&'a u32, &'a u32) | |||
for<'b, 'c> fn(&'b u32, &'c u32) | |||
``` | |||
|
|||
Here we would skolemize the supertype, as before, yielding: | |||
Here we would placeholer the supertype, as before, yielding: |
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.
Typo:
Here we would placeholer the supertype, as before, yielding: | |
Here we would placeholder the supertype, as before, yielding: |
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.
verb?
src/borrow_check/region_inference.md
Outdated
@@ -476,7 +476,7 @@ an error. That's good: the problem is that we've gone from a fn that promises | |||
to return one of its two arguments, to a fn that is promising to return the | |||
first one. That is unsound. Let's see how it plays out. | |||
|
|||
First, we skolemize the supertype: | |||
First, we placeholder the supertype: |
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.
verb?
src/traits/hrtb.md
Outdated
|
||
[hrsubtype]: https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked/README.md | ||
[paper by SPJ]: http://research.microsoft.com/en-us/um/people/simonpj/papers/higher-rank/ | ||
|
||
So let's work through our example. | ||
|
||
1. The first thing we would do is to | ||
skolemize the obligation, yielding `AnyInt : Foo<&'0 isize>` (here `'0` | ||
represents skolemized region #0). Note that we now have no quantifiers; | ||
placeholder the obligation, yielding `AnyInt : Foo<&'0 isize>` (here `'0` |
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.
verb?
@mark-i-m while re-review niko's PR, when talking about "placeholder-ify", the diff wrote "replace .. with placeholder" or "create/add placeholder". so I decide to follow his words, is this ok? |
2e1b236
to
659386f
Compare
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.
Excellent! Thanks @csmoe.
LGTM. I left a few nits/minor changes. I tried to use Github's new suggestions feature. Let me know how it works. After that, r=me 😄
Co-Authored-By: csmoe <[email protected]>
Co-Authored-By: csmoe <[email protected]>
Co-Authored-By: csmoe <[email protected]>
Co-Authored-By: csmoe <[email protected]>
r? @mark-i-m it works 😄 |
Thanks @csmoe 😄 |
Closes #211
r? @mark-i-m