Skip to content

Commit f19f454

Browse files
committed
Update run-pass test suite to use dyn
1 parent eb4580a commit f19f454

File tree

208 files changed

+502
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+502
-502
lines changed

src/test/run-pass/alignment-gep-tup-like-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ impl<A:Clone> Invokable<A> for Invoker<A> {
2222
}
2323
}
2424

25-
fn f<A:Clone + 'static>(a: A, b: u16) -> Box<Invokable<A>+'static> {
25+
fn f<A:Clone + 'static>(a: A, b: u16) -> Box<dyn Invokable<A>+'static> {
2626
box Invoker {
2727
a: a,
2828
b: b,
29-
} as (Box<Invokable<A>+'static>)
29+
} as (Box<dyn Invokable<A>+'static>)
3030
}
3131

3232
pub fn main() {

src/test/run-pass/associated-types/associated-types-doubleendediterator-object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-pass
22
#![feature(box_syntax)]
33

4-
fn pairwise_sub(mut t: Box<DoubleEndedIterator<Item=isize>>) -> isize {
4+
fn pairwise_sub(mut t: Box<dyn DoubleEndedIterator<Item=isize>>) -> isize {
55
let mut result = 0;
66
loop {
77
let front = t.next();

src/test/run-pass/associated-types/associated-types-eq-obj.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl Foo for char {
1515
fn boo(&self) -> Bar { Bar }
1616
}
1717

18-
fn baz(x: &Foo<A=Bar>) -> Bar {
18+
fn baz(x: &dyn Foo<A=Bar>) -> Bar {
1919
x.boo()
2020
}
2121

src/test/run-pass/associated-types/associated-types-projection-in-object-type.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ pub trait Subscriber {
1919

2020
pub trait Publisher<'a> {
2121
type Output;
22-
fn subscribe(&mut self, _: Box<Subscriber<Input=Self::Output> + 'a>);
22+
fn subscribe(&mut self, _: Box<dyn Subscriber<Input=Self::Output> + 'a>);
2323
}
2424

2525
pub trait Processor<'a> : Subscriber + Publisher<'a> { }
2626

2727
impl<'a, P> Processor<'a> for P where P : Subscriber + Publisher<'a> { }
2828

2929
struct MyStruct<'a> {
30-
sub: Box<Subscriber<Input=u64> + 'a>
30+
sub: Box<dyn Subscriber<Input=u64> + 'a>
3131
}
3232

3333
impl<'a> Publisher<'a> for MyStruct<'a> {
3434
type Output = u64;
35-
fn subscribe(&mut self, t : Box<Subscriber<Input=u64> + 'a>) {
35+
fn subscribe(&mut self, t : Box<dyn Subscriber<Input=u64> + 'a>) {
3636
self.sub = t;
3737
}
3838
}

src/test/run-pass/autoref-autoderef/autoderef-method-on-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ impl double for usize {
1111
}
1212

1313
pub fn main() {
14-
let x: Box<_> = box (box 3usize as Box<double>);
14+
let x: Box<_> = box (box 3usize as Box<dyn double>);
1515
assert_eq!(x.double(), 6);
1616
}

src/test/run-pass/borrowck/borrowck-trait-lifetime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::marker;
1212
fn main() {
1313
trait T { fn foo(&self) {} }
1414

15-
fn f<'a, V: T>(v: &'a V) -> &'a T {
16-
v as &'a T
15+
fn f<'a, V: T>(v: &'a V) -> &'a dyn T {
16+
v as &'a dyn T
1717
}
1818
}

src/test/run-pass/cast-rfc0401-vtable-kinds.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ impl<T> Foo<T> for () {}
1515
impl Foo<u32> for u32 { fn foo(&self, _: u32) -> u32 { self+43 } }
1616
impl Bar for () {}
1717

18-
unsafe fn round_trip_and_call<'a>(t: *const (Foo<u32>+'a)) -> u32 {
19-
let foo_e : *const Foo<u16> = t as *const _;
20-
let r_1 = foo_e as *mut Foo<u32>;
18+
unsafe fn round_trip_and_call<'a>(t: *const (dyn Foo<u32>+'a)) -> u32 {
19+
let foo_e : *const dyn Foo<u16> = t as *const _;
20+
let r_1 = foo_e as *mut dyn Foo<u32>;
2121

2222
(&*r_1).foo(0)
2323
}
@@ -38,8 +38,8 @@ fn tuple_i32_to_u32<T:?Sized>(u: *const (i32, T)) -> *const (u32, T) {
3838

3939
fn main() {
4040
let x = 4u32;
41-
let y : &Foo<u32> = &x;
42-
let fl = unsafe { round_trip_and_call(y as *const Foo<u32>) };
41+
let y : &dyn Foo<u32> = &x;
42+
let fl = unsafe { round_trip_and_call(y as *const dyn Foo<u32>) };
4343
assert_eq!(fl, (43+4));
4444

4545
let s = FooS([0,1,2]);

src/test/run-pass/cast-rfc0401.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ fn main()
2525
// coercion-cast
2626
let mut it = vec![137].into_iter();
2727
let itr: &mut vec::IntoIter<u32> = &mut it;
28-
assert_eq!((itr as &mut Iterator<Item=u32>).next(), Some(137));
29-
assert_eq!((itr as &mut Iterator<Item=u32>).next(), None);
28+
assert_eq!((itr as &mut dyn Iterator<Item=u32>).next(), Some(137));
29+
assert_eq!((itr as &mut dyn Iterator<Item=u32>).next(), None);
3030

3131
assert_eq!(Some(4u32) as Option<u32>, Some(4u32));
3232
assert_eq!((1u32,2u32) as (u32,u32), (1,2));

src/test/run-pass/close-over-big-then-small-data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ impl<A:Clone> Invokable<A> for Invoker<A> {
2424
}
2525
}
2626

27-
fn f<A:Clone + 'static>(a: A, b: u16) -> Box<Invokable<A>+'static> {
27+
fn f<A:Clone + 'static>(a: A, b: u16) -> Box<dyn Invokable<A>+'static> {
2828
box Invoker {
2929
a: a,
3030
b: b,
31-
} as (Box<Invokable<A>+'static>)
31+
} as (Box<dyn Invokable<A>+'static>)
3232
}
3333

3434
pub fn main() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() {
2-
assert_eq!((ToString::to_string as fn(&(ToString+'static)) -> String)(&"foo"),
2+
assert_eq!((ToString::to_string as fn(&(dyn ToString+'static)) -> String)(&"foo"),
33
String::from("foo"));
44
}

0 commit comments

Comments
 (0)