1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![crate_name = "foo"]
14 use std::borrow::Borrow;
16 // @has foo/fn.foo.html
17 // @has - //pre 'foo('
18 // @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"'
19 // @matches - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html'
20 pub fn foo(_x: impl Clone, _y: i32, _z: (impl Copy, impl Clone)) {
24 // @has foo/trait.Trait.html
25 // @has - 'method</a>('
26 // @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
27 fn method(&self, _x: impl std::fmt::Debug) {
34 // @has foo/struct.S.html
36 // @matches - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"'
37 pub fn bar(_bar: impl Copy) {
41 // @matches - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html'
42 pub fn baz(_baz: S<impl Clone>) {
46 // @matches - 'trait\.Read\.html'
47 pub fn qux(_qux: impl IntoIterator<Item = S<impl Read>>) {
51 // @has - 'method</a>('
52 // @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
53 impl<T> Trait for S<T> {}
55 // @has foo/fn.much_universe.html
56 // @matches - 'T:.+Borrow.+impl .+trait\.Trait\.html'
57 // @matches - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html'
58 // @matches - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
60 T: Borrow<impl Trait>,
61 U: IntoIterator<Item = impl Iterator<Item = impl Clone>>,