summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-json/traits/supertrait.rs
blob: 486a8e713f811b50a860337df062bd6d204230dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// ignore-tidy-linelength

#![feature(no_core)]
#![feature(lang_items)]
#![no_core]

// @set loud_id = supertrait.json "$.index[*][?(@.name=='Loud')].id"
pub trait Loud {}

// @set very_loud_id = - "$.index[*][?(@.name=='VeryLoud')].id"
// @count - "$.index[*][?(@.name=='VeryLoud')].inner.bounds[*]" 1
// @is -    "$.index[*][?(@.name=='VeryLoud')].inner.bounds[0].trait_bound.trait.inner.id" $loud_id
pub trait VeryLoud: Loud {}

// @set sounds_good_id = - "$.index[*][?(@.name=='SoundsGood')].id"
pub trait SoundsGood {}

// @count - "$.index[*][?(@.name=='MetalBand')].inner.bounds[*]" 2
// @is -    "$.index[*][?(@.name=='MetalBand')].inner.bounds[0].trait_bound.trait.inner.id" $very_loud_id
// @is -    "$.index[*][?(@.name=='MetalBand')].inner.bounds[1].trait_bound.trait.inner.id" $sounds_good_id
pub trait MetalBand: VeryLoud + SoundsGood {}

// @count - "$.index[*][?(@.name=='DnabLatem')].inner.bounds[*]" 2
// @is -    "$.index[*][?(@.name=='DnabLatem')].inner.bounds[1].trait_bound.trait.inner.id" $very_loud_id
// @is -    "$.index[*][?(@.name=='DnabLatem')].inner.bounds[0].trait_bound.trait.inner.id" $sounds_good_id
pub trait DnabLatem: SoundsGood + VeryLoud {}