-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attributes: remove closure type annotation in
#[instrument(err)]
(#…
…1233) ## Motivation Currently, using `#[instrument(err)]` on a function returning a `Result` with an `impl Trait` in it results in a compiler error. This is because we generate a type annotation on the closure in the function body that contains the user function's actual body, and `impl Trait` isn't allowed on types in local bindings, only on function parameters and return types. ## Solution This branch fixes the issue by simply removing the return type annotation from the closure. I've also added tests that break on master for functions returning `impl Trait`, both with and without the `err` argument. Fixes #1227 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
- Loading branch information
Showing
3 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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