summaryrefslogtreecommitdiffstats
path: root/third_party/rust/extend/tests/compile_pass/super_trait.rs
blob: 30b147d24a60232c83c0261531714298dab1c753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use extend::ext;

trait MyTrait {}

impl MyTrait for String {}

#[ext(supertraits = Default + Clone + MyTrait)]
impl String {
    fn my_len(&self) -> usize {
        self.len()
    }
}

fn main() {
    assert_eq!(String::new().my_len(), 0);
}