forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsupertrait.rs
20 lines (16 loc) · 1.02 KB
/
supertrait.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ set loud_id = "$.index[?(@.name=='Loud')].id"
pub trait Loud {}
//@ set very_loud_id = "$.index[?(@.name=='VeryLoud')].id"
//@ count "$.index[?(@.name=='VeryLoud')].inner.trait.bounds[*]" 1
//@ is "$.index[?(@.name=='VeryLoud')].inner.trait.bounds[0].trait_bound.trait.id" $loud_id
pub trait VeryLoud: Loud {}
//@ set sounds_good_id = "$.index[?(@.name=='SoundsGood')].id"
pub trait SoundsGood {}
//@ count "$.index[?(@.name=='MetalBand')].inner.trait.bounds[*]" 2
//@ is "$.index[?(@.name=='MetalBand')].inner.trait.bounds[0].trait_bound.trait.id" $very_loud_id
//@ is "$.index[?(@.name=='MetalBand')].inner.trait.bounds[1].trait_bound.trait.id" $sounds_good_id
pub trait MetalBand: VeryLoud + SoundsGood {}
//@ count "$.index[?(@.name=='DnabLatem')].inner.trait.bounds[*]" 2
//@ is "$.index[?(@.name=='DnabLatem')].inner.trait.bounds[1].trait_bound.trait.id" $very_loud_id
//@ is "$.index[?(@.name=='DnabLatem')].inner.trait.bounds[0].trait_bound.trait.id" $sounds_good_id
pub trait DnabLatem: SoundsGood + VeryLoud {}