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.
13 fn parametrized_type_is_allowed() -> Option<impl Debug> {
17 fn path_parametrized_type_is_allowed() -> option::Option<impl Debug> {
21 fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
22 //~^ ERROR `impl Trait` is not allowed in path parameters
23 //~^^ ERROR ambiguous associated type
27 fn projection_with_named_trait_is_disallowed(x: impl Iterator)
28 -> <impl Iterator as Iterator>::Item
29 //~^ ERROR `impl Trait` is not allowed in path parameters
34 fn projection_with_named_trait_inside_path_is_disallowed()
35 -> <::std::ops::Range<impl Debug> as Iterator>::Item
36 //~^ ERROR `impl Trait` is not allowed in path parameters
38 (1i32..100).next().unwrap()
41 fn projection_from_impl_trait_inside_dyn_trait_is_disallowed()
42 -> <dyn Iterator<Item = impl Debug> as Iterator>::Item
43 //~^ ERROR `impl Trait` is not allowed in path parameters