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
[WIP] experiment with a new way of effects desugaring #120639
base: master
Are you sure you want to change the base?
[WIP] experiment with a new way of effects desugaring #120639
Conversation
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
@@ -104,6 +104,11 @@ pub(super) fn explicit_item_bounds( | |||
None => {} | |||
} | |||
|
|||
// effects desugared associated types have no bounds. |
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.
Could feed this query.
Also: don't we need a where Self: Sized
bound to avoid breaking all dyn Trait
for now?
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.
assoc types don't break object safety (we'd just need to make it default to Runtime
)
what breaks object safety would probably be the const host: bool
that we now insert onto each method.
☔ The latest upstream changes (presumably #120392) made this pull request unmergeable. Please resolve the merge conflicts. |
0781e50
to
02e547e
Compare
This comment has been minimized.
This comment has been minimized.
e6fa893
to
532300c
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #120991) made this pull request unmergeable. Please resolve the merge conflicts. |
532300c
to
d42b128
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This PR changes @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
@bors try |
…ring, r=<try> [WIP] experiment with a new way of effects desugaring cc `@rust-lang/project-const-traits.` Will write down notes once I have finished. * [ ] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>` * [ ] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>` * [ ] add types and traits to minicore test * [ ] update rustc-dev-guide
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors try @rust-timer queue |
The compile error from perf is interesting. The existence of closures that only implement This means for any trait that has a I've opened #121929, and fixing that would probably unblock this. If that cannot be fixed easily, we might need to explore a workaround such as emitting two separate associated types each encoding whether it is compatible with runtime=true and compatible with runtime=false. |
☔ The latest upstream changes (presumably #122113) made this pull request unmergeable. Please resolve the merge conflicts. |
1a69524
to
1172e6c
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #124289) made this pull request unmergeable. Please resolve the merge conflicts. |
plus some other fixes.
it causes ICEs since we assume that the only substs are on the trait and the method has no generic parameters
We need to change how we handle it in the trait system before re-enabling it.
This avoids mix up when we create inference params for them and try to equate those to effect inference params.
9ebaabd
to
b1f7ebf
Compare
Noting, with initial implementation of
|
cc @rust-lang/project-const-traits. Will write down notes once I have finished.
T: Tr
to desugar intoT: Tr, T::Effects: Compat<true>
type Assoc: ~const Tr
andtype Assoc<T: ~const Tr>