diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-04-15 11:57:29 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-05-13 14:19:51 +1200 |
| commit | 843db01bd925279da0a56efde532c9e3ecf73610 (patch) | |
| tree | eed89761dcb0ddeb578ca24357ef680787eabb43 /src/test/compile-fail | |
| parent | c2b30b86df6b34ba19e87e63402e43d9e81a64fb (diff) | |
| download | rust-843db01bd925279da0a56efde532c9e3ecf73610.tar.gz rust-843db01bd925279da0a56efde532c9e3ecf73610.zip | |
eddyb's changes for DST coercions
+ lots of rebasing
Diffstat (limited to 'src/test/compile-fail')
9 files changed, 9 insertions, 23 deletions
diff --git a/src/test/compile-fail/destructure-trait-ref.rs b/src/test/compile-fail/destructure-trait-ref.rs index 4161cce2843..3f455e148a0 100644 --- a/src/test/compile-fail/destructure-trait-ref.rs +++ b/src/test/compile-fail/destructure-trait-ref.rs @@ -35,7 +35,7 @@ fn main() { // n == m let &x = &1 as &T; //~ ERROR type `&T` cannot be dereferenced let &&x = &(&1 as &T); //~ ERROR type `&T` cannot be dereferenced - let box x = box 1 as Box<T>; //~ ERROR type `Box<T>` cannot be dereferenced + let box x = box 1 as Box<T>; //~ ERROR the trait `core::marker::Sized` is not implemented // n > m let &&x = &1 as &T; diff --git a/src/test/compile-fail/dst-bad-coercions.rs b/src/test/compile-fail/dst-bad-coercions.rs index b30eada162b..b7a07e48799 100644 --- a/src/test/compile-fail/dst-bad-coercions.rs +++ b/src/test/compile-fail/dst-bad-coercions.rs @@ -33,18 +33,4 @@ pub fn main() { let x: &mut T = &S; //~ ERROR mismatched types let x: *mut T = &S; //~ ERROR mismatched types let x: *mut S = &S; //~ ERROR mismatched types - - // The below four sets of tests test that we cannot implicitly deref a *-ptr - // during a coercion. - let x: *const S = &S; - let y: *const T = x; //~ ERROR mismatched types - - let x: *mut S = &mut S; - let y: *mut T = x; //~ ERROR mismatched types - - let x: *const Foo<S> = &Foo {f: S}; - let y: *const Foo<T> = x; //~ ERROR mismatched types - - let x: *mut Foo<S> = &mut Foo {f: S}; - let y: *mut Foo<T> = x; //~ ERROR mismatched types } diff --git a/src/test/compile-fail/issue-19692.rs b/src/test/compile-fail/issue-19692.rs index 7794c34a04b..7b84ba0343a 100644 --- a/src/test/compile-fail/issue-19692.rs +++ b/src/test/compile-fail/issue-19692.rs @@ -12,7 +12,7 @@ struct Homura; fn akemi(homura: Homura) { let Some(ref madoka) = Some(homura.kaname()); //~ ERROR does not implement any method - madoka.clone(); + madoka.clone(); //~ ERROR the type of this value must be known in this context } fn main() { } diff --git a/src/test/compile-fail/issue-20261.rs b/src/test/compile-fail/issue-20261.rs index 33e00f9a823..42fd856ad87 100644 --- a/src/test/compile-fail/issue-20261.rs +++ b/src/test/compile-fail/issue-20261.rs @@ -12,6 +12,5 @@ fn main() { for (ref i,) in [].iter() { //~ ERROR: type mismatch resolving i.clone(); //~^ ERROR: the type of this value must be known in this context - //~| ERROR: reached the recursion limit while auto-dereferencing } } diff --git a/src/test/compile-fail/issue-22034.rs b/src/test/compile-fail/issue-22034.rs index c084a94d55e..8b258180e83 100644 --- a/src/test/compile-fail/issue-22034.rs +++ b/src/test/compile-fail/issue-22034.rs @@ -14,6 +14,7 @@ fn main() { let ptr: *mut () = 0 as *mut _; let _: &mut Fn() = unsafe { &mut *(ptr as *mut Fn()) - //~^ ERROR illegal cast + //~^ ERROR the trait `core::ops::Fn<()>` is not implemented + //~| ERROR the trait `core::ops::FnOnce<()>` is not implemented }; } diff --git a/src/test/compile-fail/object-lifetime-default-elision.rs b/src/test/compile-fail/object-lifetime-default-elision.rs index 4fba45e2a66..75ee0bdc9c7 100644 --- a/src/test/compile-fail/object-lifetime-default-elision.rs +++ b/src/test/compile-fail/object-lifetime-default-elision.rs @@ -81,7 +81,7 @@ fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait { // which fails to type check. ss - //~^ ERROR lifetime of the source pointer does not outlive lifetime bound + //~^ ERROR lifetime bound not satisfied //~| ERROR cannot infer } diff --git a/src/test/compile-fail/object-lifetime-default-from-box-error.rs b/src/test/compile-fail/object-lifetime-default-from-box-error.rs index 7fae530984f..dd94dfe1e08 100644 --- a/src/test/compile-fail/object-lifetime-default-from-box-error.rs +++ b/src/test/compile-fail/object-lifetime-default-from-box-error.rs @@ -25,7 +25,7 @@ fn load(ss: &mut SomeStruct) -> Box<SomeTrait> { // `Box<SomeTrait>` defaults to a `'static` bound, so this return // is illegal. - ss.r //~ ERROR lifetime of the source pointer does not outlive lifetime bound + ss.r //~ ERROR lifetime bound not satisfied } fn store(ss: &mut SomeStruct, b: Box<SomeTrait>) { @@ -38,7 +38,7 @@ fn store(ss: &mut SomeStruct, b: Box<SomeTrait>) { fn store1<'b>(ss: &mut SomeStruct, b: Box<SomeTrait+'b>) { // Here we override the lifetimes explicitly, and so naturally we get an error. - ss.r = b; //~ ERROR lifetime of the source pointer does not outlive lifetime bound + ss.r = b; //~ ERROR lifetime bound not satisfied } fn main() { diff --git a/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs b/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs index 10b883d4dc8..c5cf43e355d 100644 --- a/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs +++ b/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs @@ -27,7 +27,7 @@ fn make_object_good2<'a,'b,A:SomeTrait+'a+'b>(v: A) -> Box<SomeTrait+'b> { fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<SomeTrait+'c> { // A outlives 'a AND 'b...but not 'c. - box v as Box<SomeTrait+'a> //~ ERROR lifetime of the source pointer does not outlive + box v as Box<SomeTrait+'a> //~ ERROR lifetime bound not satisfied } fn main() { diff --git a/src/test/compile-fail/regions-trait-object-subtyping.rs b/src/test/compile-fail/regions-trait-object-subtyping.rs index f3722690ef8..b4e527972e4 100644 --- a/src/test/compile-fail/regions-trait-object-subtyping.rs +++ b/src/test/compile-fail/regions-trait-object-subtyping.rs @@ -22,7 +22,7 @@ fn foo2<'a:'b,'b>(x: &'b mut (Dummy+'a)) -> &'b mut (Dummy+'b) { fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy { // Without knowing 'a:'b, we can't coerce - x //~ ERROR lifetime of the source pointer does not outlive + x //~ ERROR lifetime bound not satisfied //~^ ERROR cannot infer } |
