Skip to content
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

Add enum discriminants (#337) #437

Merged
merged 1 commit into from
Sep 1, 2024
Merged

Conversation

obi1kenobi
Copy link
Owner

Co-authored-by: Predrag Gruevski 2348618+obi1kenobi@users.noreply.github.com

  • finally got implicit discriminants working

  • remove sync structs

  • move to Cow<'a, str> for discriminants

  • Various clean-ups, still fighting closure bounds

sigh

error[E0521]: borrowed data escapes outside of closure
--> src/adapter/edges.rs:304:28
|
260 | pub(super) fn resolve_variant_edge<'a, V: AsVertex<Vertex<'a>> + 'a>(
| -- lifetime 'a defined here
...
302 | "discriminant" => resolve_neighbors_with(contexts, move |vertex: &'_ Vertex<'a>| {
| ------ - let's call the lifetime of this reference '1
| |
| vertex is a reference that is only valid in the closure body
303 | let origin = vertex.origin;
304 | let enum_var = vertex
| ____________________________^
305 | | .as_variant()
| | ^
| | |
| |_____________________________vertex escapes the closure body here
| argument requires that '1 must outlive 'a

  • Actually clone Cow; same error as before, though...

  • Got the sucker.

  • Wrap up

  • Better dcocs for discriminant

Co-authored-by: Predrag Gruevski 2348618+obi1kenobi@users.noreply.github.com

  • Finish up docs, improve tests

  • Add name back.


Co-authored-by: Predrag Gruevski 2348618+obi1kenobi@users.noreply.github.com

* Remove nightly from rustdoc v28 test matrix, since that's now v29. (#332)

* Rust 1.78 is no longer beta. (#334)

* Add enum discriminants

* discriminant clone to lifetime annotation

* complicate test examples

* improved discriminant docs

* hedge bets against placeholder representation

Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>

* finally got implicit discriminants working

* remove sync structs

* move to Cow<'a, str> for discriminants

* Various clean-ups, still fighting closure bounds

*sigh*

error[E0521]: borrowed data escapes outside of closure
   --> src/adapter/edges.rs:304:28
    |
260 |   pub(super) fn resolve_variant_edge<'a, V: AsVertex<Vertex<'a>> + 'a>(
    |                                      -- lifetime `'a` defined here
...
302 |           "discriminant" => resolve_neighbors_with(contexts, move |vertex: &'_ Vertex<'a>| {
    |                                                                    ------  - let's call the lifetime of this reference `'1`
    |                                                                    |
    |                                                                    `vertex` is a reference that is only valid in the closure body
303 |               let origin = vertex.origin;
304 |               let enum_var = vertex
    |  ____________________________^
305 | |                 .as_variant()
    | |                             ^
    | |                             |
    | |_____________________________`vertex` escapes the closure body here
    |                               argument requires that `'1` must outlive `'a`

* Actually clone Cow; same error as before, though...

* Got the sucker.

* Wrap up

* Better dcocs for discriminant

Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>

* Finish up docs, improve tests

* Add name back.

---------

Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>
@obi1kenobi obi1kenobi enabled auto-merge (squash) September 1, 2024 16:43
@obi1kenobi obi1kenobi merged commit 50cf644 into rustdoc-v30 Sep 1, 2024
5 checks passed
@obi1kenobi obi1kenobi deleted the cp_rustdoc-v30_052469d branch September 1, 2024 16:44
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.

2 participants