File: lifetime-defined-here.rs

package info (click to toggle)
rust-async-trait 0.1.83-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 348 kB
  • sloc: makefile: 2
file content (23 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (32)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use async_trait::async_trait;

#[async_trait]
trait Foo {
    async fn bar(&self, x: &str, y: &'_ str) -> &'static str;
}

struct S(String);

#[async_trait]
impl Foo for S {
    async fn bar(&self, x: &str, y: &'_ str) -> &'static str {
        if false {
            &self.0
        } else if false {
            x
        } else {
            y
        }
    }
}

fn main() {}