]> git.lizzy.rs Git - rust.git/blobdiff - src/test/rustdoc/universal-impl-trait.rs
Suggest defining type parameter when appropriate
[rust.git] / src / test / rustdoc / universal-impl-trait.rs
index af51ff3d9419e909e2d37b320e3e026d29264427..b10b1b8658db9664ffb4e9ea4cb82cf380009ed2 100644 (file)
@@ -1,17 +1,7 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(universal_impl_trait)]
 #![crate_name = "foo"]
 
 use std::io::Read;
+use std::borrow::Borrow;
 
 // @has foo/fn.foo.html
 // @has - //pre 'foo('
@@ -51,3 +41,15 @@ pub fn qux(_qux: impl IntoIterator<Item = S<impl Read>>) {
 // @has - 'method</a>('
 // @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
 impl<T> Trait for S<T> {}
+
+// @has foo/fn.much_universe.html
+// @matches - 'T:.+Borrow.+impl .+trait\.Trait\.html'
+// @matches - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html'
+// @matches - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
+pub fn much_universe<
+    T: Borrow<impl Trait>,
+    U: IntoIterator<Item = impl Iterator<Item = impl Clone>>,
+>(
+    _: impl Read + Clone,
+) {
+}