]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/bound/not-on-struct.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / traits / bound / not-on-struct.stderr
CommitLineData
29967ef6 1error[E0226]: only a single explicit lifetime bound is permitted
6a06907d 2 --> $DIR/not-on-struct.rs:25:25
29967ef6
XL
3 |
4LL | fn e() -> 'static + A + 'static {
5 | ^^^^^^^
6
7error[E0226]: only a single explicit lifetime bound is permitted
6a06907d 8 --> $DIR/not-on-struct.rs:29:53
29967ef6
XL
9 |
10LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
11 | ^^
12
b7449926 13error[E0404]: expected trait, found struct `Foo`
6a06907d 14 --> $DIR/not-on-struct.rs:8:16
b7449926 15 |
532ac7d7 16LL | fn foo(_x: Box<Foo + Send>) { }
b7449926 17 | ^^^ not a trait
29967ef6
XL
18 |
19help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
6a06907d 20 --> $DIR/not-on-struct.rs:8:22
29967ef6
XL
21 |
22LL | fn foo(_x: Box<Foo + Send>) { }
23 | --- ^^^^ ...because of this bound
24 | |
25 | expected this type to be a trait...
b7449926
XL
26
27error[E0404]: expected trait, found struct `Vec`
6a06907d 28 --> $DIR/not-on-struct.rs:10:29
29967ef6
XL
29 |
30LL | type TypeAlias<T> = Box<dyn Vec<T>>;
31 | ^^^^^^ not a trait
32
33error[E0404]: expected trait, found struct `A`
6a06907d 34 --> $DIR/not-on-struct.rs:13:11
29967ef6
XL
35 |
36LL | fn a() -> A + 'static {
37 | ^ not a trait
38 |
39help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
6a06907d 40 --> $DIR/not-on-struct.rs:13:15
29967ef6
XL
41 |
42LL | fn a() -> A + 'static {
43 | - ^^^^^^^ ...because of this bound
44 | |
45 | expected this type to be a trait...
46help: if you meant to use a type and not a trait here, remove the bounds
47 |
94222f64
XL
48LL - fn a() -> A + 'static {
49LL + fn a() -> A {
923072b8 50 |
29967ef6
XL
51
52error[E0404]: expected trait, found enum `Result`
6a06907d 53 --> $DIR/not-on-struct.rs:16:34
29967ef6
XL
54 |
55LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
56 | ^^^^^^^^^^^ not a trait
57 |
58help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
6a06907d 59 --> $DIR/not-on-struct.rs:16:48
29967ef6
XL
60 |
61LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
62 | ----------- ^^ ...because of this bound
63 | |
64 | expected this type to be a trait...
65help: if you meant to use a type and not a trait here, remove the bounds
66 |
94222f64
XL
67LL - fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
68LL + fn b<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
923072b8 69 |
29967ef6
XL
70
71error[E0404]: expected trait, found struct `A`
6a06907d 72 --> $DIR/not-on-struct.rs:19:21
29967ef6
XL
73 |
74LL | fn c() -> 'static + A {
75 | ^ not a trait
76 |
77help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
6a06907d 78 --> $DIR/not-on-struct.rs:19:11
29967ef6
XL
79 |
80LL | fn c() -> 'static + A {
81 | ^^^^^^^ - expected this type to be a trait...
82 | |
83 | ...because of this bound
84help: if you meant to use a type and not a trait here, remove the bounds
85 |
94222f64
XL
86LL - fn c() -> 'static + A {
87LL + fn c() -> A {
923072b8 88 |
29967ef6
XL
89
90error[E0404]: expected trait, found enum `Result`
6a06907d 91 --> $DIR/not-on-struct.rs:22:39
29967ef6
XL
92 |
93LL | fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
94 | ^^^^^^^^^^^ not a trait
95 |
96help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
6a06907d 97 --> $DIR/not-on-struct.rs:22:34
29967ef6
XL
98 |
99LL | fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
100 | ^^ ----------- expected this type to be a trait...
101 | |
102 | ...because of this bound
103help: if you meant to use a type and not a trait here, remove the bounds
104 |
94222f64
XL
105LL - fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
106LL + fn d<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
923072b8 107 |
29967ef6
XL
108
109error[E0404]: expected trait, found struct `A`
6a06907d 110 --> $DIR/not-on-struct.rs:25:21
29967ef6
XL
111 |
112LL | fn e() -> 'static + A + 'static {
113 | ^ not a trait
114 |
115help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
6a06907d 116 --> $DIR/not-on-struct.rs:25:11
29967ef6
XL
117 |
118LL | fn e() -> 'static + A + 'static {
119 | ^^^^^^^ - ^^^^^^^ ...because of these bounds
120 | |
121 | expected this type to be a trait...
122help: if you meant to use a type and not a trait here, remove the bounds
123 |
94222f64
XL
124LL - fn e() -> 'static + A + 'static {
125LL + fn e() -> A {
923072b8 126 |
29967ef6
XL
127
128error[E0404]: expected trait, found enum `Result`
6a06907d 129 --> $DIR/not-on-struct.rs:29:39
29967ef6
XL
130 |
131LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
132 | ^^^^^^^^^^^ not a trait
133 |
134help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
6a06907d 135 --> $DIR/not-on-struct.rs:29:34
29967ef6
XL
136 |
137LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
138 | ^^ ----------- ^^ ...because of these bounds
139 | |
140 | expected this type to be a trait...
141help: if you meant to use a type and not a trait here, remove the bounds
142 |
94222f64
XL
143LL - fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
144LL + fn f<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
923072b8 145 |
29967ef6
XL
146
147error[E0404]: expected trait, found struct `Traitor`
6a06907d 148 --> $DIR/not-on-struct.rs:35:11
29967ef6
XL
149 |
150LL | trait Trait {}
151 | ----------- similarly named trait `Trait` defined here
152LL | fn g() -> Traitor + 'static {
153 | ^^^^^^^ not a trait
154 |
155help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
6a06907d 156 --> $DIR/not-on-struct.rs:35:21
29967ef6
XL
157 |
158LL | fn g() -> Traitor + 'static {
159 | ------- ^^^^^^^ ...because of this bound
160 | |
161 | expected this type to be a trait...
162help: if you meant to use a type and not a trait here, remove the bounds
163 |
94222f64
XL
164LL - fn g() -> Traitor + 'static {
165LL + fn g() -> Traitor {
923072b8 166 |
29967ef6 167help: a trait with a similar name exists
b7449926 168 |
29967ef6 169LL | fn g() -> Trait + 'static {
94222f64 170 | ~~~~~
b7449926 171
29967ef6 172error: aborting due to 11 previous errors
b7449926 173
29967ef6
XL
174Some errors have detailed explanations: E0226, E0404.
175For more information about an error, try `rustc --explain E0226`.