Improve stack-related compiler error messages#337
Merged
Conversation
The builder type should only be used when composing layers. Now that we have `Builder::into_inner`, we need not store a builder in the profile router.
Service stacks were built from "top" to bottom, so that the concrete service type is satisied after all middlewares are composed toegether. This leads to exceedingly complex compiler error messages. This change adds a `svc::Stack` builder that aids composing layers around a concrete inner service so that the compiler can more clearly identity the layer that violates the type contract. Note: this does *not* appear to improve compile times. No functional changes are intended.
Member
Author
|
Resumission of #331, but against master instead of a development branch |
hawkw
approved these changes
Sep 3, 2019
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Sep 5, 2019
* Stop using a Builder in the profile router (linkerd/linkerd2-proxy#330) * Update and rename .github/workflows/rust.yml to rust.yml * Fix compile error on windows (linkerd/linkerd2-proxy#335) * Revert "Update and rename .github/workflows/rust.yml to rust.yml" * travis: Allow 60 minutes for integration tests (linkerd/linkerd2-proxy#336) * tests: Properly simulate destination errors (linkerd/linkerd2-proxy#332) * Improve stack-related compiler error messages (linkerd/linkerd2-proxy#337) * update hyper to v0.12.34
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Sep 5, 2019
* Stop using a Builder in the profile router (linkerd/linkerd2-proxy#330) * Update and rename .github/workflows/rust.yml to rust.yml * Fix compile error on windows (linkerd/linkerd2-proxy#335) * Revert "Update and rename .github/workflows/rust.yml to rust.yml" * travis: Allow 60 minutes for integration tests (linkerd/linkerd2-proxy#336) * tests: Properly simulate destination errors (linkerd/linkerd2-proxy#332) * Improve stack-related compiler error messages (linkerd/linkerd2-proxy#337) * update hyper to v0.12.34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Service stacks were built from "top" to bottom, so that the concrete
service type is satisfied after all middlewares are composed together.
This leads to exceedingly complex compiler error messages.
This change adds a svc::Stack builder that aids composing layers
around a concrete inner service so that the compiler can more clearly
identity the layer that violates the type contract.
Note: this does not appear to improve compile times.
No functional changes are intended.