Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
turbo-tasks: Expand
<T as TaskOutput>::Return
values in macros (ver…
…cel/turborepo#8096) Previously, we'd generate function return types like: ```rust <Vc<AssetIdent> as TaskOutput>::Return ``` which is equivalent to the much simpler: ```rust Vc<AssetIdent> ``` That approach is nice because it's easier to implement in the macros, and it's more correct, because it uses the type system to verify the type of `Vc` and `Result` are what we expect. However, it makes the rustdoc output much harder to read. This attempts to the expansion of `TaskOutput::Return` inside the macro to generate more readable documentation, at the cost of some correctness. <details> <summary><strong>Rustdoc Before</strong></summary> ![Screenshot 2024-05-06 at 5.35.11 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/6a64062d-9fa8-42b9-8788-0972735dfcc8.png) </details> <details> <summary><strong>Rustdoc After</strong></summary> ![Screenshot 2024-05-06 at 5.35.01 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/86995431-6e87-4205-ad23-54a2ddb7a535.png) </details> <details> <summary><strong>Example compilation error</strong> with an invalid return type</summary> ![Screenshot 2024-05-06 at 5.48.00 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/257cb449-4b8e-4fde-8ee0-0b2af1b7b435.png) </details>
- Loading branch information