summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-json/fns/generic_returns.rs
blob: 1a0f33fe3d28e50567b115b16e83526b873e9a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// ignore-tidy-linelength

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

// @count generic_returns.json "$.index[*][?(@.name=='generic_returns')].inner.items[*]" 2

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

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

struct Fooer {}

impl Foo for Fooer {}