2 #![allow(type_alias_bounds)]
8 fn generic_function<X: Foo>(x: X) {}
10 enum E where i32: Foo { V } //~ ERROR
12 struct S where i32: Foo; //~ ERROR
14 trait T where i32: Foo {} //~ ERROR
16 union U where i32: Foo { f: i32 } //~ ERROR
18 type Y where i32: Foo = (); // OK - bound is ignored
20 impl Foo for () where i32: Foo { //~ ERROR
24 generic_function(5i32);
28 fn f() where i32: Foo //~ ERROR
33 generic_function(5i32);
36 fn use_op(s: String) -> String where String: ::std::ops::Neg<Output=String> { //~ ERROR
40 fn use_for() where i32: Iterator { //~ ERROR
48 struct Dst<X: ?Sized> {
52 struct TwoStrs(str, str) where str: Sized; //~ ERROR
55 fn unsized_local() where Dst<dyn A>: Sized { //~ ERROR
56 let x: Dst<dyn A> = *(Box::new(Dst { x: 1 }) as Box<Dst<dyn A>>);
59 fn return_str() -> str where str: Sized { //~ ERROR
60 *"Sized".to_string().into_boxed_str()
63 // This is currently accepted because the function pointer isn't
65 fn global_hr(x: fn(&())) where fn(&()): Foo { // OK