diff options
Diffstat (limited to 'src/test')
6 files changed, 27 insertions, 0 deletions
diff --git a/src/test/compile-fail/generic-associated-types.rs b/src/test/compile-fail/generic-associated-types.rs new file mode 100644 index 00000000000..a8fc8226f31 --- /dev/null +++ b/src/test/compile-fail/generic-associated-types.rs @@ -0,0 +1,17 @@ +// Copyright 2012 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. + +use std::ops::Deref; + +trait PointerFamily { + type Pointer<T>: Deref<Target = T>; +} + +fn main() {} diff --git a/src/test/run-pass/rfc1598-generic-associated-types/construct_with_other_type.rs b/src/test/run-pass/rfc1598-generic-associated-types/construct_with_other_type.rs index d3102360532..81475c6888d 100644 --- a/src/test/run-pass/rfc1598-generic-associated-types/construct_with_other_type.rs +++ b/src/test/run-pass/rfc1598-generic-associated-types/construct_with_other_type.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(generic_associated_types)] + trait Foo { type Bar<'a, 'b>; } diff --git a/src/test/run-pass/rfc1598-generic-associated-types/iterable.rs b/src/test/run-pass/rfc1598-generic-associated-types/iterable.rs index f52a77fb258..40b1d131292 100644 --- a/src/test/run-pass/rfc1598-generic-associated-types/iterable.rs +++ b/src/test/run-pass/rfc1598-generic-associated-types/iterable.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(generic_associated_types)] + trait Iterable { type Item<'a>; type Iter<'a>: Iterator<Item = Self::Item<'a>>; diff --git a/src/test/run-pass/rfc1598-generic-associated-types/pointer_family.rs b/src/test/run-pass/rfc1598-generic-associated-types/pointer_family.rs index 4ec6b418c05..0d0f1396969 100644 --- a/src/test/run-pass/rfc1598-generic-associated-types/pointer_family.rs +++ b/src/test/run-pass/rfc1598-generic-associated-types/pointer_family.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(generic_associated_types)] + use std::rc::Rc; use std::sync::Arc; use std::ops::Deref; diff --git a/src/test/run-pass/rfc1598-generic-associated-types/streaming_iterator.rs b/src/test/run-pass/rfc1598-generic-associated-types/streaming_iterator.rs index 33be5c1cc63..fd476e2592d 100644 --- a/src/test/run-pass/rfc1598-generic-associated-types/streaming_iterator.rs +++ b/src/test/run-pass/rfc1598-generic-associated-types/streaming_iterator.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(generic_associated_types)] + use std::fmt::Display; trait StreamingIterator { diff --git a/src/test/run-pass/rfc1598-generic-associated-types/where.rs b/src/test/run-pass/rfc1598-generic-associated-types/where.rs index 8fe7ebc1309..269e5dc26fc 100644 --- a/src/test/run-pass/rfc1598-generic-associated-types/where.rs +++ b/src/test/run-pass/rfc1598-generic-associated-types/where.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(generic_associated_types)] + // Checking the interaction with this other feature #![feature(associated_type_defaults)] |
