Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
change output file
  • Loading branch information
mellowagain committed Oct 25, 2023
commit fe651424283c0a0b91f6667400e7124caee7fdf1
3 changes: 1 addition & 2 deletions autometrics/tests/result_labels/fail/async_trait_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ impl TestTrait for TestStruct {
}
}

#[test]
fn test_async_trait() {
fn main() {
let ts = TestStruct::default();

async move {
Expand Down
22 changes: 22 additions & 0 deletions autometrics/tests/result_labels/fail/async_trait_support.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,25 @@ error: #[async_trait] must be defined BEFORE #[autometrics]
| ^^^^^^^^^^^^^^
|
= note: this error originates in the attribute macro `autometrics` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `TestStruct: TestTrait` is not satisfied
--> tests/result_labels/fail/async_trait_support.rs:31:9
|
31 | <TestStruct as TestTrait>::method().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TestTrait` is not implemented for `TestStruct`

error[E0599]: no method named `self_method` found for struct `TestStruct` in the current scope
--> tests/result_labels/fail/async_trait_support.rs:32:12
|
13 | struct TestStruct;
| ----------------- method `self_method` not found for this struct
...
32 | ts.self_method().await;
| ^^^^^^^^^^^ method not found in `TestStruct`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `TestTrait` defines an item `self_method`, perhaps you need to implement it
--> tests/result_labels/fail/async_trait_support.rs:7:1
|
7 | trait TestTrait {
| ^^^^^^^^^^^^^^^