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

test: demo the implementation is not general enough issue #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tisonkun
Copy link
Contributor

@tisonkun tisonkun commented Feb 8, 2025

No description provided.

Comment on lines +44 to +73
// #[test]
// fn test_lifetime_nok() {
// let rt1 = tokio::runtime::Runtime::new().unwrap();
// let rt2 = tokio::runtime::Runtime::new().unwrap();
//
// let spawn = rt1.spawn(async move {
// let mut interval = fastimer::interval(Duration::from_secs(1), timer());
// for _ in 0..3 {
// interval.tick().await;
// }
// });
//
// rt2.block_on(spawn).unwrap();
// }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Failed to compile:

error: implementation of `MakeDelay` is not general enough
  --> fastimer-tokio/tests/lifetime.rs:49:17
   |
49 |       let spawn = rt1.spawn(async move {
   |  _________________^
50 | |         let mut interval = fastimer::interval(Duration::from_secs(1), timer());
51 | |         for _ in 0..3 {
52 | |             interval.tick().await;
53 | |         }
54 | |     });
   | |______^ implementation of `MakeDelay` is not general enough
   |
   = note: `&'0 MakeTokioDelay` must implement `MakeDelay`, for any lifetime `'0`...
   = note: ...but `MakeDelay` is actually implemented for the type `&'static MakeTokioDelay`

@tisonkun tisonkun force-pushed the demo-lifetime-issue branch from f246da5 to df95a68 Compare February 8, 2025 01:46
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
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.

1 participant