]> git.proxmox.com Git - rustc.git/blame - src/test/ui/associated-type-bounds/inside-adt.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / associated-type-bounds / inside-adt.rs
CommitLineData
dc9dc135
XL
1#![feature(associated_type_bounds)]
2#![feature(untagged_unions)]
3
4struct S1 { f: dyn Iterator<Item: Copy> }
e1599b0c 5//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
dc9dc135 6struct S2 { f: Box<dyn Iterator<Item: Copy>> }
e1599b0c 7//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
dc9dc135 8struct S3 { f: dyn Iterator<Item: 'static> }
e1599b0c 9//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
dc9dc135
XL
10
11enum E1 { V(dyn Iterator<Item: Copy>) }
e1599b0c 12//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
1b1a35ee 13//~| ERROR the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)`
dc9dc135 14enum E2 { V(Box<dyn Iterator<Item: Copy>>) }
e1599b0c 15//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
dc9dc135 16enum E3 { V(dyn Iterator<Item: 'static>) }
e1599b0c 17//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
1b1a35ee 18//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)`
dc9dc135
XL
19
20union U1 { f: dyn Iterator<Item: Copy> }
e1599b0c 21//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
1b1a35ee 22//~| ERROR the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)`
dc9dc135 23union U2 { f: Box<dyn Iterator<Item: Copy>> }
e1599b0c 24//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
dc9dc135 25union U3 { f: dyn Iterator<Item: 'static> }
e1599b0c 26//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
1b1a35ee 27//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)`
e1599b0c
XL
28
29fn main() {}