Skip to content

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>
@tisonkun tisonkun closed this Apr 9, 2025
@tisonkun tisonkun deleted the demo-lifetime-issue branch April 9, 2025 08:03
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.

2 participants