Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions tracing-attributes/tests/ui/fail/async_instrument.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ error[E0308]: mismatched types
--> tests/ui/fail/async_instrument.rs:10:5
|
10 | ""
| ^^- help: try using a conversion method: `.to_string()`
| |
| expected `String`, found `&str`
| ^^ expected `String`, found `&str`
|
note: return type inferred to be `String` here
--> tests/ui/fail/async_instrument.rs:9:31
|
9 | async fn simple_mismatch() -> String {
9 | async fn simple_mismatch() -> String {
| ^^^^^^
help: try using a conversion method
|
10 | "".to_string()
| ++++++++++++

error[E0277]: `(&str,)` doesn't implement `std::fmt::Display`
--> tests/ui/fail/async_instrument.rs:14:57
Expand Down Expand Up @@ -76,15 +78,17 @@ error[E0308]: mismatched types
--> tests/ui/fail/async_instrument.rs:35:16
|
35 | return "";
| ^^- help: try using a conversion method: `.to_string()`
| |
| expected `String`, found `&str`
| ^^ expected `String`, found `&str`
|
note: return type inferred to be `String` here
--> tests/ui/fail/async_instrument.rs:33:28
|
33 | async fn early_return() -> String {
| ^^^^^^
help: try using a conversion method
|
35 | return "".to_string();
| ++++++++++++

error[E0308]: mismatched types
--> tests/ui/fail/async_instrument.rs:40:1
Expand Down
16 changes: 10 additions & 6 deletions tracing-core/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,10 @@ mod test {
use crate::metadata::{Kind, Level, Metadata};

// Make sure TEST_CALLSITE_* have non-zero size, so they can't be located at the same address.
struct TestCallsite1();
static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1();
struct TestCallsite1 {
_unused: u8,
}
static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1 { _unused: 0 };
static TEST_META_1: Metadata<'static> = metadata! {
name: "field_test1",
target: module_path!(),
Expand All @@ -1149,8 +1151,10 @@ mod test {
}
}

struct TestCallsite2();
static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2();
struct TestCallsite2 {
_unused: u8,
}
static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2 { _unused: 0 };
static TEST_META_2: Metadata<'static> = metadata! {
name: "field_test2",
target: module_path!(),
Expand Down Expand Up @@ -1238,7 +1242,7 @@ mod test {

struct MyVisitor;
impl Visit for MyVisitor {
fn record_debug(&mut self, field: &Field, _: &dyn (fmt::Debug)) {
fn record_debug(&mut self, field: &Field, _: &dyn fmt::Debug) {
assert_eq!(field.callsite(), TEST_META_1.callsite())
}
}
Expand All @@ -1257,7 +1261,7 @@ mod test {

struct MyVisitor;
impl Visit for MyVisitor {
fn record_debug(&mut self, field: &Field, _: &dyn (fmt::Debug)) {
fn record_debug(&mut self, field: &Field, _: &dyn fmt::Debug) {
assert_eq!(field.name(), "bar")
}
}
Expand Down
Loading