1 // Copyright 2012 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(generic_associated_types)]
13 //FIXME(#44265): "type parameter not allowed" errors will be addressed in a follow-up PR
20 type Pointer<T>: Deref<Target = T>;
21 fn new<T>(value: T) -> Self::Pointer<T>;
22 //~^ ERROR type parameters are not allowed on this type [E0109]
27 impl PointerFamily for ArcFamily {
28 type Pointer<T> = Arc<T>;
29 fn new<T>(value: T) -> Self::Pointer<T> {
30 //~^ ERROR type parameters are not allowed on this type [E0109]
37 impl PointerFamily for RcFamily {
38 type Pointer<T> = Rc<T>;
39 fn new<T>(value: T) -> Self::Pointer<T> {
40 //~^ ERROR type parameters are not allowed on this type [E0109]
45 struct Foo<P: PointerFamily> {
46 bar: P::Pointer<String>,
47 //~^ ERROR type parameters are not allowed on this type [E0109]