Skip to content

Conversation

@eggyal
Copy link
Contributor

@eggyal eggyal commented Jun 22, 2022

For folding operations that cannot fail, the existing fallible folding trait is a little unergonomic. This PR introduces an infallible folder trait that can be used as a more ergonomic alternative in such cases, reflecting the status quo in rustc.

Infallible folders must however also implement the fallible trait (it's a supertrait of the infallible one), but such implementation should merely delegate to the infallible trait. Coherence rules unfortunately do not permit this to be provided by blanket implementation, however delegating implementations can be simply derived on infallible folders via the chalk_derive::FallibleTypeFolder macro.

r? @jackh726

@jackh726
Copy link
Member

jackh726 commented Oct 3, 2022

Let's merge this

@bors r+

@bors
Copy link
Contributor

bors commented Oct 3, 2022

📌 Commit 994bc59 has been approved by jackh726

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 3, 2022

⌛ Testing commit 994bc59 with merge b460e4b...

@bors
Copy link
Contributor

bors commented Oct 3, 2022

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing b460e4b to master...

@bors bors merged commit b460e4b into rust-lang:master Oct 3, 2022
@eggyal eggyal deleted the split-fallible-infallible-folding branch October 4, 2022 18:34
lowr added a commit to lowr/rust-analyzer that referenced this pull request Oct 13, 2022
Two things:
- `TypeFolder` has been split into `TypeFolder` and `FallibleTypeFolder` (rust-lang/chalk#772)
- `ProjectionTy::self_type_parameter()` has been removed (rust-lang/chalk#778)
bors added a commit that referenced this pull request Oct 13, 2022
Fix parameter for `Interner` in `derive(FallibleTypeFolder)` macro

In custom derive macro for `FallibleTypeFolder` introduced in #772, there's one occurrence of raw type parameter that is not guaranteed to exist. This patch replaces it with `#interner` to be interpolated at proc macro runtime like in other methods.
bors added a commit to rust-lang/rust-analyzer that referenced this pull request Oct 16, 2022
Bump chalk

There's a bug in current chalk that prevents us from properly supporting GATs, which is supposed to be fixed in v0.86. Note the following:
- v0.86 is only going to be released next Sunday so I'll keep this PR as draft until then.
- This doesn't compile without rust-lang/chalk#779, which I hope will be included in v0.86. I confirmed this compiles with it locally.

Two breaking changes from v0.84:
- `TypeFolder` has been split into `TypeFolder` and `FallibleTypeFolder` (rust-lang/chalk#772)
- `ProjectionTy::self_type_parameter()` has been removed (rust-lang/chalk#778)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants