Debian Codegraph @

third_party/rust/tracing-attributes/tests/ui/async_instrument.rs

raw
1 #![allow(unreachable_code)]
2
3 #[tracing::instrument]
4 async fn unit() {
5 ""
6 }
7
8 #[tracing::instrument]
9 async fn simple_mismatch() -> String {
10 ""
11 }
12
13 // FIXME: this span is still pretty poor
14 #[tracing::instrument]
15 async fn opaque_unsatisfied() -> impl std::fmt::Display {
16 ("",)
17 }
18
19 struct Wrapper<T>(T);
20
21 #[tracing::instrument]
22 async fn mismatch_with_opaque() -> Wrapper<impl std::fmt::Display> {
23 ""
24 }
25
26 #[tracing::instrument]
27 async fn early_return_unit() {
28 if true {
29 return "";
30 }
31 }
32
33 #[tracing::instrument]
34 async fn early_return() -> String {
35 if true {
36 return "";
37 }
38 String::new()
39 }
40
41 #[tracing::instrument]
42 async fn extra_semicolon() -> i32 {
43 1;
44 }
45
46 fn main() {}