diff options
29 files changed, 38 insertions, 446 deletions
diff --git a/src/test/run-pass/re_rebalance_coherence/auxiliary/re_rebalance_coherence_lib.rs b/src/test/run-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs index c8d027b25c7..c8d027b25c7 100644 --- a/src/test/run-pass/re_rebalance_coherence/auxiliary/re_rebalance_coherence_lib.rs +++ b/src/test/run-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs diff --git a/src/test/run-pass/coherence/coherence-bigint-int.rs b/src/test/run-pass/coherence/coherence-bigint-int.rs index 02945e9dade..0c9abdc15e6 100644 --- a/src/test/run-pass/coherence/coherence-bigint-int.rs +++ b/src/test/run-pass/coherence/coherence-bigint-int.rs @@ -1,5 +1,8 @@ // run-pass // aux-build:coherence_lib.rs +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/coherence/coherence-bigint-vecint.rs b/src/test/run-pass/coherence/coherence-bigint-vecint.rs index a5dba90be5c..38e0be0aa9a 100644 --- a/src/test/run-pass/coherence/coherence-bigint-vecint.rs +++ b/src/test/run-pass/coherence/coherence-bigint-vecint.rs @@ -1,5 +1,8 @@ // run-pass // aux-build:coherence_lib.rs +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/coherence/coherence-blanket.rs b/src/test/run-pass/coherence/coherence-blanket.rs index 55fa89d7507..5d310cc2c6a 100644 --- a/src/test/run-pass/coherence/coherence-blanket.rs +++ b/src/test/run-pass/coherence/coherence-blanket.rs @@ -1,6 +1,9 @@ // run-pass #![allow(unused_imports)] // aux-build:coherence_lib.rs +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/coherence/coherence-covered-type-parameter.rs b/src/test/run-pass/coherence/coherence-covered-type-parameter.rs index bb95c59d183..1cf039f0831 100644 --- a/src/test/run-pass/coherence/coherence-covered-type-parameter.rs +++ b/src/test/run-pass/coherence/coherence-covered-type-parameter.rs @@ -1,6 +1,9 @@ // run-pass #![allow(dead_code)] // aux-build:coherence_lib.rs +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/coherence/coherence-impl-in-fn.rs b/src/test/run-pass/coherence/coherence-impl-in-fn.rs index b9719731748..09e2c1e5a4e 100644 --- a/src/test/run-pass/coherence/coherence-impl-in-fn.rs +++ b/src/test/run-pass/coherence/coherence-impl-in-fn.rs @@ -1,4 +1,7 @@ // run-pass +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs b/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs index 43a0a5c4277..051cc280b2d 100644 --- a/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs +++ b/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs @@ -1,4 +1,7 @@ // run-pass +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] #![allow(dead_code)] // aux-build:coherence_lib.rs diff --git a/src/test/run-pass/coherence/coherence-iterator-vec.rs b/src/test/run-pass/coherence/coherence-iterator-vec.rs index 386fe40ac3c..df6e808f7de 100644 --- a/src/test/run-pass/coherence/coherence-iterator-vec.rs +++ b/src/test/run-pass/coherence/coherence-iterator-vec.rs @@ -1,4 +1,7 @@ // run-pass +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] #![allow(dead_code)] // aux-build:coherence_lib.rs diff --git a/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs b/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs index fa1d4bbb496..6a816664c48 100644 --- a/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs +++ b/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs @@ -1,4 +1,7 @@ // run-pass +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] #![allow(unused_imports)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/coherence/coherence-negative-impls-safe.rs b/src/test/run-pass/coherence/coherence-negative-impls-safe.rs index 695a71cbd2d..98b04489ac4 100644 --- a/src/test/run-pass/coherence/coherence-negative-impls-safe.rs +++ b/src/test/run-pass/coherence/coherence-negative-impls-safe.rs @@ -1,4 +1,7 @@ // run-pass +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/coherence/coherence-rfc447-constrained.rs b/src/test/run-pass/coherence/coherence-rfc447-constrained.rs index 9d1d8688325..4da54d386fd 100644 --- a/src/test/run-pass/coherence/coherence-rfc447-constrained.rs +++ b/src/test/run-pass/coherence/coherence-rfc447-constrained.rs @@ -1,4 +1,7 @@ // run-pass +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] // check that trait matching can handle impls whose types are only // constrained by a projection. diff --git a/src/test/run-pass/coherence/coherence-where-clause.rs b/src/test/run-pass/coherence/coherence-where-clause.rs index 9f8a1b9bd16..28397420385 100644 --- a/src/test/run-pass/coherence/coherence-where-clause.rs +++ b/src/test/run-pass/coherence/coherence-where-clause.rs @@ -1,4 +1,8 @@ // run-pass +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] + use std::fmt::Debug; use std::default::Default; diff --git a/src/test/run-pass/coherence/coherence_copy_like.rs b/src/test/run-pass/coherence/coherence_copy_like.rs index 92af341ccb5..653f76264c1 100644 --- a/src/test/run-pass/coherence/coherence_copy_like.rs +++ b/src/test/run-pass/coherence/coherence_copy_like.rs @@ -1,4 +1,7 @@ // run-pass +// revisions: old re + +#![cfg_attr(re, feature(re_rebalance_coherence))] #![allow(dead_code)] // Test that we are able to introduce a negative constraint that // `MyType: !MyTrait` along with other "fundamental" wrappers. diff --git a/src/test/run-pass/re_rebalance_coherence/re-rebalance-coherence.rs b/src/test/run-pass/coherence/re-rebalance-coherence.rs index 33ad4e97536..bacd3b89fad 100644 --- a/src/test/run-pass/re_rebalance_coherence/re-rebalance-coherence.rs +++ b/src/test/run-pass/coherence/re-rebalance-coherence.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] #![feature(re_rebalance_coherence)] // run-pass diff --git a/src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_copy_like_lib.rs b/src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_copy_like_lib.rs deleted file mode 100644 index d3d389c6a8b..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_copy_like_lib.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 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. - -#![crate_type = "rlib"] -#![feature(fundamental)] - -pub trait MyCopy { } -impl MyCopy for i32 { } - -pub struct MyStruct<T>(T); - -#[fundamental] -pub struct MyFundamentalStruct<T>(T); diff --git a/src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_lib.rs b/src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_lib.rs deleted file mode 100644 index daa123849e4..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_lib.rs +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -#![crate_type="lib"] - -pub trait Remote { - fn foo(&self) { } -} - -pub trait Remote1<T> { - fn foo(&self, t: T) { } -} - -pub trait Remote2<T, U> { - fn foo(&self, t: T, u: U) { } -} - -pub struct Pair<T,U>(T,U); diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-bigint-int.rs b/src/test/run-pass/re_rebalance_coherence/coherence-bigint-int.rs deleted file mode 100644 index c436901a34f..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-bigint-int.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 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. - -#![feature(re_rebalance_coherence)] - -// run-pass -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -pub struct BigInt; - -impl Remote1<BigInt> for isize { } - -fn main() { } diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-bigint-vecint.rs b/src/test/run-pass/re_rebalance_coherence/coherence-bigint-vecint.rs deleted file mode 100644 index 67fb9d1d335..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-bigint-vecint.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 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. - -#![feature(re_rebalance_coherence)] - -// run-pass -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -pub struct BigInt; - -impl Remote1<BigInt> for Vec<isize> { } - -fn main() { } diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-blanket.rs b/src/test/run-pass/re_rebalance_coherence/coherence-blanket.rs deleted file mode 100644 index 7f8f27f39b1..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-blanket.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 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. - -// run-pass -#![allow(unused_imports)] -#![feature(re_rebalance_coherence)] -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -pub trait Local { - fn foo(&self) { } -} - -impl<T> Local for T { } - -fn main() { } diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-covered-type-parameter.rs b/src/test/run-pass/re_rebalance_coherence/coherence-covered-type-parameter.rs deleted file mode 100644 index 5e0d61884f9..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-covered-type-parameter.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 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. - -// run-pass -#![allow(dead_code)] -#![feature(re_rebalance_coherence)] -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote; - -struct Foo<T>(T); - -impl<T> Remote for Foo<T> { } - -fn main() { } diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-impl-in-fn.rs b/src/test/run-pass/re_rebalance_coherence/coherence-impl-in-fn.rs deleted file mode 100644 index 2f8cbc032f2..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-impl-in-fn.rs +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -// run-pass -#![allow(dead_code)] -#![allow(non_camel_case_types)] -#![feature(re_rebalance_coherence)] - -pub fn main() { - #[derive(Copy, Clone)] - enum x { foo } - impl ::std::cmp::PartialEq for x { - fn eq(&self, other: &x) -> bool { - (*self) as isize == (*other) as isize - } - fn ne(&self, other: &x) -> bool { !(*self).eq(other) } - } -} diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec-any-elem.rs b/src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec-any-elem.rs deleted file mode 100644 index b19bede7441..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec-any-elem.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 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. - -// run-pass -#![allow(dead_code)] -#![feature(re_rebalance_coherence)] -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -struct Foo<T>(T); - -impl<T,U> Remote1<U> for Foo<T> { } - -fn main() { } diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec.rs b/src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec.rs deleted file mode 100644 index 5ce71f5d422..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 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. - -// run-pass -#![allow(dead_code)] -#![feature(re_rebalance_coherence)] -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -struct Foo<T>(T); - -impl<T> Remote1<T> for Foo<T> { } - -fn main() { } diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-multidispatch-tuple.rs b/src/test/run-pass/re_rebalance_coherence/coherence-multidispatch-tuple.rs deleted file mode 100644 index 6dc1da3376b..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-multidispatch-tuple.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 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. - -// run-pass -#![allow(unused_imports)] -#![feature(re_rebalance_coherence)] -// pretty-expanded FIXME #23616 - -use std::fmt::Debug; -use std::default::Default; - -// Test that an impl for homogeneous pairs does not conflict with a -// heterogeneous pair. - -trait MyTrait { - fn get(&self) -> usize; -} - -impl<T> MyTrait for (T,T) { - fn get(&self) -> usize { 0 } -} - -impl MyTrait for (usize,isize) { - fn get(&self) -> usize { 0 } -} - -fn main() { -} diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-negative-impls-safe.rs b/src/test/run-pass/re_rebalance_coherence/coherence-negative-impls-safe.rs deleted file mode 100644 index 5e1a0e39e23..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-negative-impls-safe.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 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. - -// run-pass -#![allow(dead_code)] -// pretty-expanded FIXME #23616 - -#![feature(optin_builtin_traits)] -#![feature(re_rebalance_coherence)] - -use std::marker::Send; - -struct TestType; - -impl !Send for TestType {} - -fn main() {} diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-rfc447-constrained.rs b/src/test/run-pass/re_rebalance_coherence/coherence-rfc447-constrained.rs deleted file mode 100644 index 651e595bde1..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-rfc447-constrained.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2015 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. - -#![feature(re_rebalance_coherence)] - -// run-pass -// check that trait matching can handle impls whose types are only -// constrained by a projection. - -trait IsU32 {} -impl IsU32 for u32 {} - -trait Mirror { type Image: ?Sized; } -impl<T: ?Sized> Mirror for T { type Image = T; } - -trait Bar {} -impl<U: Mirror, V: Mirror<Image=L>, L: Mirror<Image=U>> Bar for V - where U::Image: IsU32 {} - -trait Foo { fn name() -> &'static str; } -impl Foo for u64 { fn name() -> &'static str { "u64" } } -impl<T: Bar> Foo for T { fn name() -> &'static str { "Bar" }} - -fn main() { - assert_eq!(<u64 as Foo>::name(), "u64"); - assert_eq!(<u32 as Foo>::name(), "Bar"); -} diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-subtyping.rs b/src/test/run-pass/re_rebalance_coherence/coherence-subtyping.rs deleted file mode 100644 index d9a9f580cfa..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-subtyping.rs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 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. - -#![feature(re_rebalance_coherence)] - -// run-pass -// Test that two distinct impls which match subtypes of one another -// yield coherence errors (or not) depending on the variance. - -trait Contravariant { - fn foo(&self) { } -} - -impl Contravariant for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 { -} - -impl Contravariant for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { -} - -/////////////////////////////////////////////////////////////////////////// - -trait Covariant { - fn foo(&self) { } -} - -impl Covariant for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 { -} - -impl Covariant for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { -} - -/////////////////////////////////////////////////////////////////////////// - -trait Invariant { - fn foo(&self) { } -} - -impl Invariant for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 { -} - -impl Invariant for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { -} - -fn main() { } diff --git a/src/test/run-pass/re_rebalance_coherence/coherence-where-clause.rs b/src/test/run-pass/re_rebalance_coherence/coherence-where-clause.rs deleted file mode 100644 index a7d3602a3cc..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence-where-clause.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2014 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. - -#![feature(re_rebalance_coherence)] - -// run-pass -use std::fmt::Debug; -use std::default::Default; - -trait MyTrait { - fn get(&self) -> Self; -} - -impl<T> MyTrait for T - where T : Default -{ - fn get(&self) -> T { - Default::default() - } -} - -#[derive(Clone, Copy, Debug, PartialEq)] -struct MyType { - dummy: usize -} - -impl MyTrait for MyType { - fn get(&self) -> MyType { (*self).clone() } -} - -fn test_eq<M>(m: M, n: M) -where M : MyTrait + Debug + PartialEq -{ - assert_eq!(m.get(), n); -} - -pub fn main() { - test_eq(0_usize, 0_usize); - - let value = MyType { dummy: 256 + 22 }; - test_eq(value, value); -} diff --git a/src/test/run-pass/re_rebalance_coherence/coherence_copy_like.rs b/src/test/run-pass/re_rebalance_coherence/coherence_copy_like.rs deleted file mode 100644 index 221095b148e..00000000000 --- a/src/test/run-pass/re_rebalance_coherence/coherence_copy_like.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015 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. - -// run-pass -#![allow(dead_code)] -#![feature(re_rebalance_coherence)] - -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// aux-build:coherence_copy_like_lib.rs - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -trait MyTrait { } -impl<T: lib::MyCopy> MyTrait for T { } -impl MyTrait for MyType { } -impl<'a> MyTrait for &'a MyType { } -impl MyTrait for Box<MyType> { } -impl<'a> MyTrait for &'a Box<MyType> { } - -fn main() { } |
