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 #![feature(conservative_impl_trait)]
13 pub fn g() -> impl Iterator<Item=u8> {
17 pub fn h() -> (impl Iterator<Item=u8>) {
21 pub fn i() -> impl Iterator<Item=u8> + 'static {
25 pub fn j() -> impl Iterator<Item=u8> + Clone {
29 pub fn k() -> [impl Clone; 2] {
33 pub fn l() -> (impl Clone, impl Default) {
37 pub fn m() -> &'static impl Clone {
41 pub fn n() -> *const impl Clone {
45 pub fn o() -> &'static [impl Clone] {
50 pub fn test_44731_0() -> Box<impl Iterator<Item=u8>> {
54 pub fn test_44731_1() -> Result<Box<impl Clone>, ()> {
58 // NOTE these involve Fn sugar, where impl Trait is disallowed for now, see issue #45994
60 //pub fn test_44731_2() -> Box<Fn(impl Clone)> {
61 // Box::new(|_: u32| {})
64 //pub fn test_44731_3() -> Box<Fn() -> impl Clone> {
68 pub fn test_44731_4() -> Box<Iterator<Item=impl Clone>> {
72 // @has issue_43869/fn.g.html
73 // @has issue_43869/fn.h.html
74 // @has issue_43869/fn.i.html
75 // @has issue_43869/fn.j.html
76 // @has issue_43869/fn.k.html
77 // @has issue_43869/fn.l.html
78 // @has issue_43869/fn.m.html
79 // @has issue_43869/fn.n.html
80 // @has issue_43869/fn.o.html
81 // @has issue_43869/fn.test_44731_0.html
82 // @has issue_43869/fn.test_44731_1.html
83 // @has issue_43869/fn.test_44731_4.html