2016-10-24 14:40:43 -05:00
|
|
|
use std::ops::Deref;
|
|
|
|
|
|
|
|
// Due to aggressive error message deduplication, we require 20 *different*
|
|
|
|
// unsized types (even Path and [u8] are considered the "same").
|
|
|
|
|
|
|
|
trait Foo {}
|
|
|
|
trait Bar {}
|
|
|
|
trait FooBar {}
|
|
|
|
trait BarFoo {}
|
|
|
|
|
|
|
|
trait PathHelper1 {}
|
|
|
|
trait PathHelper2 {}
|
|
|
|
trait PathHelper3 {}
|
|
|
|
trait PathHelper4 {}
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
struct Path1(dyn PathHelper1);
|
|
|
|
struct Path2(dyn PathHelper2);
|
|
|
|
struct Path3(dyn PathHelper3);
|
|
|
|
struct Path4(dyn PathHelper4);
|
2016-10-24 14:40:43 -05:00
|
|
|
|
|
|
|
enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
|
|
|
|
// parameter
|
2018-06-09 18:53:36 -05:00
|
|
|
VA(W),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VB{x: X},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VC(isize, Y),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VD{u: isize, x: Z},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2016-10-24 14:40:43 -05:00
|
|
|
|
|
|
|
// slice / str
|
2018-06-09 18:53:36 -05:00
|
|
|
VE([u8]),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VF{x: str},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VG(isize, [f32]),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VH{u: isize, x: [u32]},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2016-10-24 14:40:43 -05:00
|
|
|
|
|
|
|
// unsized struct
|
2018-06-09 18:53:36 -05:00
|
|
|
VI(Path1),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VJ{x: Path2},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VK(isize, Path3),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2018-06-09 18:53:36 -05:00
|
|
|
VL{u: isize, x: Path4},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2016-10-24 14:40:43 -05:00
|
|
|
|
|
|
|
// plain trait
|
2019-05-28 13:46:13 -05:00
|
|
|
VM(dyn Foo),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2019-05-28 13:46:13 -05:00
|
|
|
VN{x: dyn Bar},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2019-05-28 13:46:13 -05:00
|
|
|
VO(isize, dyn FooBar),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2019-05-28 13:46:13 -05:00
|
|
|
VP{u: isize, x: dyn BarFoo},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2016-10-24 14:40:43 -05:00
|
|
|
|
|
|
|
// projected
|
2018-06-09 18:53:36 -05:00
|
|
|
VQ(<&'static [i8] as Deref>::Target),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2016-10-24 14:40:43 -05:00
|
|
|
VR{x: <&'static [char] as Deref>::Target},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2016-10-24 14:40:43 -05:00
|
|
|
VS(isize, <&'static [f64] as Deref>::Target),
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2016-10-24 14:40:43 -05:00
|
|
|
VT{u: isize, x: <&'static [i32] as Deref>::Target},
|
2018-07-10 16:10:13 -05:00
|
|
|
//~^ ERROR the size for values of type
|
2016-10-24 14:40:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn main() { }
|