Skip to content

Commit dee8b54

Browse files
committed
Fallout in tests --- misc error message changes, WF fixes
1 parent f4aaedb commit dee8b54

24 files changed

+64
-34
lines changed

src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ fn bar<F>(blk: F) where F: FnOnce() + 'static {
1212
}
1313

1414
fn foo(x: &()) {
15-
bar(|| { //~ ERROR cannot infer an appropriate lifetime
15+
bar(|| {
16+
//~^ ERROR cannot infer
17+
//~| ERROR does not fulfill
1618
let _ = x;
1719
})
1820
}

src/test/compile-fail/issue-18389.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
use std::any::Any;
1212
use std::any::TypeId;
1313

14-
pub trait Pt {}
15-
pub trait Rt {}
16-
17-
trait Private<P: Pt, R: Rt> {
14+
trait Private<P, R> {
1815
fn call(&self, p: P, r: R);
1916
}
2017
pub trait Public: Private< //~ ERROR private trait in exported type parameter bound

src/test/compile-fail/issue-20005.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ trait To {
1919
self //~ error: the trait `core::marker::Sized` is not implemented
2020
) -> <Dst as From<Self>>::Result where Dst: From<Self> {
2121
From::from( //~ error: the trait `core::marker::Sized` is not implemented
22+
//~^ ERROR E0277
2223
self
2324
)
2425
}

src/test/compile-fail/issue-23041.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ fn main()
1313
{
1414
fn bar(x:i32) ->i32 { 3*x };
1515
let b:Box<Any> = Box::new(bar as fn(_)->_);
16-
b.downcast_ref::<fn(_)->_>();
17-
//~^ ERROR cannot determine a type for this expression: unconstrained type
16+
b.downcast_ref::<fn(_)->_>(); //~ ERROR E0101
1817
}

src/test/compile-fail/issue-24013.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ fn main() {
1313
let a = 1;
1414
let b = 2;
1515
unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
16-
//~^ ERROR cannot determine a type for this expression: unconstrained type
16+
//~^ ERROR unable to infer enough type information about `_`
1717
}

src/test/compile-fail/issue-3907-2.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct S {
1717
name: isize
1818
}
1919

20-
fn bar(_x: Foo) {} //~ ERROR the trait `core::marker::Sized` is not implemented
20+
fn bar(_x: Foo) {}
21+
//~^ ERROR E0277
2122

2223
fn main() {}

src/test/compile-fail/kindck-inherited-copy-bound.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ fn a() {
3131
fn b() {
3232
let x: Box<_> = box 3;
3333
let y = &x;
34-
let z = &x as &Foo; //~ ERROR E0038
34+
let z = &x as &Foo;
35+
//~^ ERROR E0038
36+
//~| ERROR E0038
3537
}
3638

3739
fn main() { }

src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn with_assoc<'a,'b>() {
4747
// outlive 'a. In this case, that means TheType<'b>::TheAssocType,
4848
// which is &'b (), must outlive 'a.
4949

50-
let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR cannot infer
50+
let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR reference has a longer lifetime
5151
}
5252

5353
fn main() {

src/test/compile-fail/regions-close-object-into-object-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#![allow(warnings)]
1313

1414
trait A<T> { }
15-
struct B<'a, T>(&'a (A<T>+'a));
15+
struct B<'a, T:'a>(&'a (A<T>+'a));
1616

1717
trait X { }
1818

src/test/compile-fail/regions-close-object-into-object-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(box_syntax)]
1212

1313
trait A<T> { }
14-
struct B<'a, T>(&'a (A<T>+'a));
14+
struct B<'a, T:'a>(&'a (A<T>+'a));
1515

1616
trait X { }
1717
impl<'a, T> X for B<'a, T> {}

0 commit comments

Comments
 (0)