-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Move binder for dyn to each list item #79945
Conversation
@@ -87,7 +87,7 @@ pub struct CtxtInterners<'tcx> { | |||
substs: InternedSet<'tcx, InternalSubsts<'tcx>>, | |||
canonical_var_infos: InternedSet<'tcx, List<CanonicalVarInfo<'tcx>>>, | |||
region: InternedSet<'tcx, RegionKind>, | |||
existential_predicates: InternedSet<'tcx, List<ExistentialPredicate<'tcx>>>, | |||
poly_existential_predicates: InternedSet<'tcx, List<ty::Binder<ExistentialPredicate<'tcx>>>>, |
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.
This name change probably isn't necessary, but I would like to hear thoughts.
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.
seems fine
@@ -616,24 +616,28 @@ impl<'tcx> Relate<'tcx> for &'tcx ty::List<ty::ExistentialPredicate<'tcx>> { | |||
// in `a`. | |||
let mut a_v: Vec<_> = a.into_iter().collect(); | |||
let mut b_v: Vec<_> = b.into_iter().collect(); | |||
a_v.sort_by(|a, b| a.stable_cmp(tcx, b)); | |||
a_v.sort_by(|a, b| a.skip_binder().stable_cmp(tcx, &b.skip_binder())); |
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.
This seems fine, but I think it works only because we are moving towards a "normalized" form where bound things are referenced purely by index, and this binder has exactly one bound item.
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.
Might be worth adding a comment about this.
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.
(In particular, if we had something like for<'a>...
and for<'b>...
, and the late-bound regions referenced them by name, those are equivalent, but they might be sorted differently.)
r=me with comment |
@bors delegate+ |
✌️ @jackh726 can now approve this pull request |
Alright, so the trivial explanation here is simply that Given that, @bors r=nikomatsakis |
📌 Commit 01c2520 has been approved by |
…ikomatsakis Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.` r? `@nikomatsakis`
…ikomatsakis Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in ``@rust-lang/wg-traits.`` r? ``@nikomatsakis``
…ikomatsakis Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in ```@rust-lang/wg-traits.``` r? ```@nikomatsakis```
…ikomatsakis Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in ````@rust-lang/wg-traits.```` r? ````@nikomatsakis````
…ikomatsakis Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `````@rust-lang/wg-traits.````` r? `````@nikomatsakis`````
…ikomatsakis Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in ``````@rust-lang/wg-traits.`````` r? ``````@nikomatsakis``````
@bors r- NLL test needs to be blessed (this is causing the rollups to fail) |
error: higher-ranked subtype error | ||
--> $DIR/issue-40000.rs:6:9 | ||
| | ||
LL | foo(bar); | ||
| ^^^ | ||
|
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.
Not exactly sure why this particular error gets duplicated. But, this is a pretty unhelpful error anyways and other tests have similar duplication for it (sometimes multiple). So, any fix for this duplication should probably be part of a larger, unrelated fix.
Test has been blessed. As I said in comment above, this particular error, while duplicated, isn't helpful, is duplicated in other tests, and a fix is an orthogonal change. @bors r=nikomatsakis |
📌 Commit 2edd301 has been approved by |
☀️ Test successful - checks-actions |
…omatsakis Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.` r? `@nikomatsakis`
…omatsakis Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.` r? `@nikomatsakis`
This essentially changes
ty::Binder<&'tcx List<ExistentialTraitRef>>
to&'tcx List<ty::Binder<ExistentialTraitRef>>
.This is a first step in moving the
dyn Trait
representation closer to Chalk, which we've talked about in @rust-lang/wg-traits.r? @nikomatsakis