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

attributes: check if a skipped parameter exists #600

Merged
merged 2 commits into from
Feb 25, 2020

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Feb 24, 2020

This PR adds a check to the #[instrument] macro to emit a compiler error if the user tries to skip non-existing parameters.

Fixes: #562

@Kobzol Kobzol requested a review from hawkw February 24, 2020 23:21
@hawkw
Copy link
Member

hawkw commented Feb 24, 2020

Looks like the CI failure is because rustfmt needs to be run?

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested one grammar tweak in the compiler error. Besides that, and running rustfmt, this branch looks great — I'll be happy to merge it as soon as the CI build passes and my one suggestion is addressed.

tracing-attributes/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hawkw hawkw merged commit d533f90 into tokio-rs:master Feb 25, 2020
@Kobzol Kobzol deleted the check-skip branch February 25, 2020 22:19
hawkw added a commit that referenced this pull request Feb 26, 2020
Added:

- Support for adding arbitrary literal fields to spans generated by
  `#[instrument]` (#569)
- `#[instrument]` now emits a helpful compiler error when attempting to
  skip a function parameter (#600)

Thanks to @Kobzol for contributing to this release!

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this pull request Feb 26, 2020
### Added

- Support for adding arbitrary literal fields to spans generated by
  `#[instrument]` (#569)
- `#[instrument]` now emits a helpful compiler error when attempting to
  skip a function parameter (#600)

Thanks to @Kobzol for contributing to this release!

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this pull request Feb 26, 2020
Added:

- **field**: `field::Empty` type for declaring empty fields whose values
  will be recorded later (#548)
- **field**: `field::Value` implementations for `Wrapping` and `NonZero*`
  numbers (#538)
- **attributes**: Support for adding arbitrary literal fields to spans
  generated by `#[instrument]` (#569)
- **attributes**: `#[instrument]` now emits a helpful compiler error when
  attempting to skip a function parameter (#600)

Changed:

- **attributes**: The `#[instrument]` attribute was placed under an
  on-by-default  feature flag "attributes" (#603)

Fixed:

- Broken and unresolvable links in RustDoc (#595)

Thanks to @oli-cosmian and @Kobzol for contributing to this release!

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this pull request Feb 27, 2020
### Added

- **field**: `field::Empty` type for declaring empty fields whose values
  will be recorded later (#548)
- **field**: `field::Value` implementations for `Wrapping` and `NonZero*`
  numbers (#538)
- **attributes**: Support for adding arbitrary literal fields to spans
  generated by `#[instrument]` (#569)
- **attributes**: `#[instrument]` now emits a helpful compiler error when
  attempting to skip a function parameter (#600)

### Changed

- **attributes**: The `#[instrument]` attribute was placed under an
  on-by-default  feature flag "attributes" (#603)

### Fixed

- Broken and unresolvable links in RustDoc (#595)

Thanks to @oli-cosmian and @Kobzol for contributing to this release!

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
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.

Check existence of arguments to tracing::instrument's skip attribute
2 participants