Skip to content

Commit 5b425c1

Browse files
committed
Fix fallout in tests.
1 parent 1b3734f commit 5b425c1

22 files changed

+27
-27
lines changed

src/test/auxiliary/method_self_arg2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl Foo {
3232
}
3333
}
3434

35-
pub trait Bar {
35+
pub trait Bar : Sized {
3636
fn foo1(&self);
3737
fn foo2(self);
3838
fn foo3(self: Box<Self>);

src/test/compile-fail/dst-sized-trait-param.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// parameter, the corresponding value must be sized. Also that the
1313
// self type must be sized if appropriate.
1414

15-
trait Foo<T> { fn take(self, x: &T) { } } // Note: T is sized
15+
trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
1616

1717
impl Foo<[int]> for uint { }
1818
//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[int]`

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ fn main() {
1515
let r: Box<Foo> = box 5;
1616
let _m: Box<Foo> = r as Box<Foo>;
1717
//~^ ERROR `core::kinds::Sized` is not implemented for the type `Foo`
18-
//~| ERROR `Foo` is not implemented for the type `Foo`
1918
}

src/test/compile-fail/regions-infer-bound-from-trait-self.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { }
2323

2424
// In these case, `Self` inherits `'static`.
2525

26-
trait InheritsFromStatic : 'static {
26+
trait InheritsFromStatic : Sized + 'static {
2727
fn foo1<'a>(self, x: Inv<'a>) {
2828
check_bound(x, self)
2929
}
3030
}
31-
trait InheritsFromStaticIndirectly : Static {
31+
trait InheritsFromStaticIndirectly : Sized + Static {
3232
fn foo1<'a>(self, x: Inv<'a>) {
3333
check_bound(x, self)
3434
}
@@ -37,21 +37,21 @@ trait InheritsFromStaticIndirectly : Static {
3737

3838
// In these case, `Self` inherits `'a`.
3939

40-
trait InheritsFromIs<'a> : 'a {
40+
trait InheritsFromIs<'a> : Sized + 'a {
4141
fn foo(self, x: Inv<'a>) {
4242
check_bound(x, self)
4343
}
4444
}
4545

46-
trait InheritsFromIsIndirectly<'a> : Is<'a> {
46+
trait InheritsFromIsIndirectly<'a> : Sized + Is<'a> {
4747
fn foo(self, x: Inv<'a>) {
4848
check_bound(x, self)
4949
}
5050
}
5151

5252
// In this case, `Self` inherits nothing.
5353

54-
trait InheritsFromNothing<'a> {
54+
trait InheritsFromNothing<'a> : Sized {
5555
fn foo(self, x: Inv<'a>) {
5656
check_bound(x, self)
5757
//~^ ERROR parameter type `Self` may not live long enough

src/test/compile-fail/trait-matching-lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct Foo<'a,'b> {
1616
y: &'b int,
1717
}
1818

19-
trait Tr {
19+
trait Tr : Sized {
2020
fn foo(x: Self) {}
2121
}
2222

src/test/compile-fail/trait-safety-fn-body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Check that an unsafe impl does not imply that unsafe actions are
1212
// legal in the methods.
1313

14-
unsafe trait UnsafeTrait {
14+
unsafe trait UnsafeTrait : Sized {
1515
fn foo(self) { }
1616
}
1717

src/test/compile-fail/type-params-in-different-spaces-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Test static calls to make sure that we align the Self and input
1212
// type parameters on a trait correctly.
1313

14-
trait Tr<T> {
14+
trait Tr<T> : Sized {
1515
fn op(T) -> Self;
1616
}
1717

src/test/compile-fail/type-params-in-different-spaces-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
trait Tr {
11+
trait Tr : Sized {
1212
fn test<X>(u: X) -> Self {
1313
u //~ ERROR mismatched types
1414
}

src/test/compile-fail/unsized4.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
// Test that bounds are sized-compatible.
1212

13-
trait T {}
14-
13+
trait T : Sized {}
1514
fn f<Sized? Y: T>() {
1615
//~^ERROR incompatible bounds on `Y`, bound `T` does not allow unsized type
1716
}

src/test/debuginfo/issue7712.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// compile-flags:--debuginfo=1
1212
// min-lldb-version: 310
1313

14-
pub trait TraitWithDefaultMethod {
14+
pub trait TraitWithDefaultMethod : Sized {
1515
fn method(self) {
1616
()
1717
}

src/test/debuginfo/self-in-default-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct Struct {
118118
x: int
119119
}
120120

121-
trait Trait {
121+
trait Trait : Sized {
122122
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
123123
zzz(); // #break
124124
arg1 + arg2

src/test/debuginfo/self-in-generic-default-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct Struct {
118118
x: int
119119
}
120120

121-
trait Trait {
121+
trait Trait : Sized {
122122

123123
fn self_by_ref<T>(&self, arg1: int, arg2: T) -> int {
124124
zzz(); // #break

src/test/run-pass/associated-types-impl-redirect.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(associated_types, lang_items, unboxed_closures)]
2020
#![no_implicit_prelude]
2121

22+
use std::kinds::Sized;
2223
use std::option::Option::{None, Some, mod};
2324

2425
trait Iterator {
@@ -27,7 +28,7 @@ trait Iterator {
2728
fn next(&mut self) -> Option<Self::Item>;
2829
}
2930

30-
trait IteratorExt: Iterator {
31+
trait IteratorExt: Iterator + Sized {
3132
fn by_ref(&mut self) -> ByRef<Self> {
3233
ByRef(self)
3334
}

src/test/run-pass/associated-types-projection-bound-in-supertraits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trait Not {
2121
fn not(self) -> Self::Result;
2222
}
2323

24-
trait Int: Not<Result=Self> {
24+
trait Int: Not<Result=Self> + Sized {
2525
fn count_ones(self) -> uint;
2626
fn count_zeros(self) -> uint {
2727
// neither works

src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(associated_types, lang_items, unboxed_closures)]
2020
#![no_implicit_prelude]
2121

22+
use std::kinds::Sized;
2223
use std::option::Option::{None, Some, mod};
2324

2425
trait Iterator {
@@ -27,7 +28,7 @@ trait Iterator {
2728
fn next(&mut self) -> Option<Self::Item>;
2829
}
2930

30-
trait IteratorExt: Iterator {
31+
trait IteratorExt: Iterator + Sized {
3132
fn by_ref(&mut self) -> ByRef<Self> {
3233
ByRef(self)
3334
}

src/test/run-pass/bug-7183-generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
trait Speak {
11+
trait Speak : Sized {
1212
fn say(&self, s:&str) -> String;
1313
fn hi(&self) -> String { hello(self) }
1414
}

src/test/run-pass/builtin-superkinds-self-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Tests the ability for the Self type in default methods to use
1212
// capabilities granted by builtin kinds as supertraits.
1313

14-
trait Foo : Send {
14+
trait Foo : Send + Sized {
1515
fn foo(self, tx: Sender<Self>) {
1616
tx.send(self);
1717
}

src/test/run-pass/default-method-supertrait-vtable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trait Y {
2121
}
2222

2323

24-
trait Z: Y {
24+
trait Z: Y + Sized {
2525
fn x(self) -> int {
2626
require_y(self)
2727
}

src/test/run-pass/issue-7320.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111

12-
trait Foo {
12+
trait Foo : Sized {
1313
fn foo(self: Box<Self>) { bar(self as Box<Foo>); }
1414
}
1515

src/test/run-pass/issue-8171-default-method-self-inherit-builtin-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
fn require_send<T: Send>(_: T){}
1818

19-
trait TragicallySelfIsNotSend: Send {
19+
trait TragicallySelfIsNotSend: Send + Sized {
2020
fn x(self) {
2121
require_send(self);
2222
}

src/test/run-pass/method-self-arg-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct Foo;
1616

1717
impl Copy for Foo {}
1818

19-
trait Bar {
19+
trait Bar : Sized {
2020
fn foo1(&self);
2121
fn foo2(self);
2222
fn foo3(self: Box<Self>);

src/test/run-pass/self-in-mut-slot-default-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct X {
1313
a: int
1414
}
1515

16-
trait Changer {
16+
trait Changer : Sized {
1717
fn change(mut self) -> Self {
1818
self.set_to(55);
1919
self

0 commit comments

Comments
 (0)