1 // Copyright 2017 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 pub fn g() -> impl Iterator<Item=u8> {
15 pub fn h() -> (impl Iterator<Item=u8>) {
19 pub fn i() -> impl Iterator<Item=u8> + 'static {
23 pub fn j() -> impl Iterator<Item=u8> + Clone {
27 pub fn k() -> [impl Clone; 2] {
31 pub fn l() -> (impl Clone, impl Default) {
35 pub fn m() -> &'static impl Clone {
39 pub fn n() -> *const impl Clone {
43 pub fn o() -> &'static [impl Clone] {
48 pub fn test_44731_0() -> Box<impl Iterator<Item=u8>> {
52 pub fn test_44731_1() -> Result<Box<impl Clone>, ()> {
56 // NOTE these involve Fn sugar, where impl Trait is disallowed for now, see issue #45994
58 //pub fn test_44731_2() -> Box<Fn(impl Clone)> {
59 // Box::new(|_: u32| {})
62 //pub fn test_44731_3() -> Box<Fn() -> impl Clone> {
66 pub fn test_44731_4() -> Box<Iterator<Item=impl Clone>> {
70 // @has issue_43869/fn.g.html
71 // @has issue_43869/fn.h.html
72 // @has issue_43869/fn.i.html
73 // @has issue_43869/fn.j.html
74 // @has issue_43869/fn.k.html
75 // @has issue_43869/fn.l.html
76 // @has issue_43869/fn.m.html
77 // @has issue_43869/fn.n.html
78 // @has issue_43869/fn.o.html
79 // @has issue_43869/fn.test_44731_0.html
80 // @has issue_43869/fn.test_44731_1.html
81 // @has issue_43869/fn.test_44731_4.html