1 error[E0226]: only a single explicit lifetime bound is permitted
2 --> $DIR/not-on-struct.rs:25:25
4 LL | fn e() -> 'static + A + 'static {
7 error[E0226]: only a single explicit lifetime bound is permitted
8 --> $DIR/not-on-struct.rs:29:53
10 LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
13 error[E0404]: expected trait, found struct `Foo`
14 --> $DIR/not-on-struct.rs:8:16
16 LL | fn foo(_x: Box<Foo + Send>) { }
19 help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
20 --> $DIR/not-on-struct.rs:8:22
22 LL | fn foo(_x: Box<Foo + Send>) { }
23 | --- ^^^^ ...because of this bound
25 | expected this type to be a trait...
27 error[E0404]: expected trait, found struct `Vec`
28 --> $DIR/not-on-struct.rs:10:29
30 LL | type TypeAlias<T> = Box<dyn Vec<T>>;
33 error[E0404]: expected trait, found struct `A`
34 --> $DIR/not-on-struct.rs:13:11
36 LL | fn a() -> A + 'static {
39 help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
40 --> $DIR/not-on-struct.rs:13:15
42 LL | fn a() -> A + 'static {
43 | - ^^^^^^^ ...because of this bound
45 | expected this type to be a trait...
46 help: if you meant to use a type and not a trait here, remove the bounds
48 LL - fn a() -> A + 'static {
52 error[E0404]: expected trait, found enum `Result`
53 --> $DIR/not-on-struct.rs:16:34
55 LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
56 | ^^^^^^^^^^^ not a trait
58 help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
59 --> $DIR/not-on-struct.rs:16:48
61 LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
62 | ----------- ^^ ...because of this bound
64 | expected this type to be a trait...
65 help: if you meant to use a type and not a trait here, remove the bounds
67 LL - fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
68 LL + fn b<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
71 error[E0404]: expected trait, found struct `A`
72 --> $DIR/not-on-struct.rs:19:21
74 LL | fn c() -> 'static + A {
77 help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
78 --> $DIR/not-on-struct.rs:19:11
80 LL | fn c() -> 'static + A {
81 | ^^^^^^^ - expected this type to be a trait...
83 | ...because of this bound
84 help: if you meant to use a type and not a trait here, remove the bounds
86 LL - fn c() -> 'static + A {
90 error[E0404]: expected trait, found enum `Result`
91 --> $DIR/not-on-struct.rs:22:39
93 LL | fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
94 | ^^^^^^^^^^^ not a trait
96 help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
97 --> $DIR/not-on-struct.rs:22:34
99 LL | fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
100 | ^^ ----------- expected this type to be a trait...
102 | ...because of this bound
103 help: if you meant to use a type and not a trait here, remove the bounds
105 LL - fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
106 LL + fn d<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
109 error[E0404]: expected trait, found struct `A`
110 --> $DIR/not-on-struct.rs:25:21
112 LL | fn e() -> 'static + A + 'static {
115 help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
116 --> $DIR/not-on-struct.rs:25:11
118 LL | fn e() -> 'static + A + 'static {
119 | ^^^^^^^ - ^^^^^^^ ...because of these bounds
121 | expected this type to be a trait...
122 help: if you meant to use a type and not a trait here, remove the bounds
124 LL - fn e() -> 'static + A + 'static {
128 error[E0404]: expected trait, found enum `Result`
129 --> $DIR/not-on-struct.rs:29:39
131 LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
132 | ^^^^^^^^^^^ not a trait
134 help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
135 --> $DIR/not-on-struct.rs:29:34
137 LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
138 | ^^ ----------- ^^ ...because of these bounds
140 | expected this type to be a trait...
141 help: if you meant to use a type and not a trait here, remove the bounds
143 LL - fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
144 LL + fn f<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
147 error[E0404]: expected trait, found struct `Traitor`
148 --> $DIR/not-on-struct.rs:35:11
151 | ----------- similarly named trait `Trait` defined here
152 LL | fn g() -> Traitor + 'static {
153 | ^^^^^^^ not a trait
155 help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
156 --> $DIR/not-on-struct.rs:35:21
158 LL | fn g() -> Traitor + 'static {
159 | ------- ^^^^^^^ ...because of this bound
161 | expected this type to be a trait...
162 help: if you meant to use a type and not a trait here, remove the bounds
164 LL - fn g() -> Traitor + 'static {
165 LL + fn g() -> Traitor {
167 help: a trait with a similar name exists
169 LL | fn g() -> Trait + 'static {
172 error: aborting due to 11 previous errors
174 Some errors have detailed explanations: E0226, E0404.
175 For more information about an error, try `rustc --explain E0226`.