about summary refs log tree commit diff
path: root/tests/rustdoc-json/fns/generic_returns.rs
blob: a0d4c745599cb988fe0917d64e0efa1c79c5a876 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ count "$.index[?(@.name=='generic_returns')].inner.module.items[*]" 2

//@ set foo = "$.index[?(@.name=='Foo')].id"
pub trait Foo {}

//@ is "$.index[?(@.name=='get_foo')].inner.function.sig.inputs" []
//@ count "$.index[?(@.name=='get_foo')].inner.function.sig.output.impl_trait[*]" 1
//@ is "$.index[?(@.name=='get_foo')].inner.function.sig.output.impl_trait[0].trait_bound.trait.id" $foo
pub fn get_foo() -> impl Foo {
    Fooer {}
}

struct Fooer {}

impl Foo for Fooer {}