rust/tests/rustdoc-json/traits/supertrait.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
1.1 KiB
Rust
Raw Normal View History

2022-02-20 16:51:05 -06:00
// ignore-tidy-linelength
#![feature(no_core)]
#![feature(lang_items)]
#![no_core]
2022-08-17 05:55:09 -05:00
// @set loud_id = "$.index[*][?(@.name=='Loud')].id"
2022-02-20 16:51:05 -06:00
pub trait Loud {}
2022-08-17 05:55:09 -05:00
// @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
2022-02-20 16:51:05 -06:00
pub trait VeryLoud: Loud {}
2022-08-17 05:55:09 -05:00
// @set sounds_good_id = "$.index[*][?(@.name=='SoundsGood')].id"
2022-02-20 16:51:05 -06:00
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
2022-02-20 16:51:05 -06:00
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
2022-02-20 16:51:05 -06:00
pub trait DnabLatem: SoundsGood + VeryLoud {}