Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakuyume committed Jan 9, 2024
1 parent 07b4900 commit 2d47a74
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tracing-attributes/tests/instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ fn repro_2294() {
let i = 42;
}

// Reproduces a compile error when an instrumented function signature contains lifetimes
// (https://github.com/tokio-rs/tracing/issues/2796).
#[instrument(err)]
fn repro_2796_err(x: &mut u8) -> Result<&u8, &u8> {
Ok(&*x)
}
#[instrument(ret)]
fn repro_2796_ret(x: &mut u8) -> Result<&u8, &u8> {
Ok(&*x)
}
#[instrument(err, ret)]
fn repro_2796_err_ret(x: &mut u8) -> Result<&u8, &u8> {
Ok(&*x)
}

#[test]
fn override_everything() {
#[instrument(target = "my_target", level = "debug")]
Expand Down

0 comments on commit 2d47a74

Please sign in to comment.