Bläddra i källkod

Backwards type propagation leads to cryptic errors

In the committed code, the chosen type is from the second error
declaration and not the first.
rust-46606
Mahmoud Al-Qudsi 1 år sedan
incheckning
7808841390
4 ändrade filer med 240 tillägg och 0 borttagningar
  1. 2
    0
      .gitignore
  2. 210
    0
      Cargo.lock
  3. 8
    0
      Cargo.toml
  4. 20
    0
      src/main.rs

+ 2
- 0
.gitignore Visa fil

@@ -0,0 +1,2 @@
1
+/target/
2
+**/*.rs.bk

+ 210
- 0
Cargo.lock Visa fil

@@ -0,0 +1,210 @@
1
+[[package]]
2
+name = "bitflags"
3
+version = "0.7.0"
4
+source = "registry+https://github.com/rust-lang/crates.io-index"
5
+
6
+[[package]]
7
+name = "byteorder"
8
+version = "1.2.1"
9
+source = "registry+https://github.com/rust-lang/crates.io-index"
10
+
11
+[[package]]
12
+name = "bytes"
13
+version = "0.4.5"
14
+source = "registry+https://github.com/rust-lang/crates.io-index"
15
+dependencies = [
16
+ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
17
+ "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
18
+]
19
+
20
+[[package]]
21
+name = "cfg-if"
22
+version = "0.1.2"
23
+source = "registry+https://github.com/rust-lang/crates.io-index"
24
+
25
+[[package]]
26
+name = "fuchsia-zircon"
27
+version = "0.2.1"
28
+source = "registry+https://github.com/rust-lang/crates.io-index"
29
+dependencies = [
30
+ "fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
31
+]
32
+
33
+[[package]]
34
+name = "fuchsia-zircon-sys"
35
+version = "0.2.0"
36
+source = "registry+https://github.com/rust-lang/crates.io-index"
37
+dependencies = [
38
+ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
39
+]
40
+
41
+[[package]]
42
+name = "futures"
43
+version = "0.1.17"
44
+source = "registry+https://github.com/rust-lang/crates.io-index"
45
+
46
+[[package]]
47
+name = "futuretest"
48
+version = "0.1.0"
49
+dependencies = [
50
+ "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
51
+ "tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
52
+]
53
+
54
+[[package]]
55
+name = "iovec"
56
+version = "0.1.1"
57
+source = "registry+https://github.com/rust-lang/crates.io-index"
58
+dependencies = [
59
+ "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
60
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
61
+]
62
+
63
+[[package]]
64
+name = "kernel32-sys"
65
+version = "0.2.2"
66
+source = "registry+https://github.com/rust-lang/crates.io-index"
67
+dependencies = [
68
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
69
+ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
70
+]
71
+
72
+[[package]]
73
+name = "lazycell"
74
+version = "0.5.1"
75
+source = "registry+https://github.com/rust-lang/crates.io-index"
76
+
77
+[[package]]
78
+name = "libc"
79
+version = "0.2.34"
80
+source = "registry+https://github.com/rust-lang/crates.io-index"
81
+
82
+[[package]]
83
+name = "log"
84
+version = "0.3.8"
85
+source = "registry+https://github.com/rust-lang/crates.io-index"
86
+
87
+[[package]]
88
+name = "mio"
89
+version = "0.6.11"
90
+source = "registry+https://github.com/rust-lang/crates.io-index"
91
+dependencies = [
92
+ "fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
93
+ "fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
94
+ "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
95
+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
96
+ "lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
97
+ "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
98
+ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
99
+ "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
100
+ "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
101
+ "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
102
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
103
+]
104
+
105
+[[package]]
106
+name = "miow"
107
+version = "0.2.1"
108
+source = "registry+https://github.com/rust-lang/crates.io-index"
109
+dependencies = [
110
+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
111
+ "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
112
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
113
+ "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
114
+]
115
+
116
+[[package]]
117
+name = "net2"
118
+version = "0.2.31"
119
+source = "registry+https://github.com/rust-lang/crates.io-index"
120
+dependencies = [
121
+ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
122
+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
123
+ "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
124
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
125
+ "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
126
+]
127
+
128
+[[package]]
129
+name = "scoped-tls"
130
+version = "0.1.0"
131
+source = "registry+https://github.com/rust-lang/crates.io-index"
132
+
133
+[[package]]
134
+name = "slab"
135
+version = "0.3.0"
136
+source = "registry+https://github.com/rust-lang/crates.io-index"
137
+
138
+[[package]]
139
+name = "slab"
140
+version = "0.4.0"
141
+source = "registry+https://github.com/rust-lang/crates.io-index"
142
+
143
+[[package]]
144
+name = "tokio-core"
145
+version = "0.1.10"
146
+source = "registry+https://github.com/rust-lang/crates.io-index"
147
+dependencies = [
148
+ "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
149
+ "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
150
+ "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
151
+ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
152
+ "mio 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
153
+ "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
154
+ "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
155
+ "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
156
+]
157
+
158
+[[package]]
159
+name = "tokio-io"
160
+version = "0.1.4"
161
+source = "registry+https://github.com/rust-lang/crates.io-index"
162
+dependencies = [
163
+ "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
164
+ "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
165
+ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
166
+]
167
+
168
+[[package]]
169
+name = "winapi"
170
+version = "0.2.8"
171
+source = "registry+https://github.com/rust-lang/crates.io-index"
172
+
173
+[[package]]
174
+name = "winapi-build"
175
+version = "0.1.1"
176
+source = "registry+https://github.com/rust-lang/crates.io-index"
177
+
178
+[[package]]
179
+name = "ws2_32-sys"
180
+version = "0.2.1"
181
+source = "registry+https://github.com/rust-lang/crates.io-index"
182
+dependencies = [
183
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
184
+ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
185
+]
186
+
187
+[metadata]
188
+"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
189
+"checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23"
190
+"checksum bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d828f97b58cc5de3e40c421d0cf2132d6b2da4ee0e11b8632fa838f0f9333ad6"
191
+"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
192
+"checksum fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f6c0581a4e363262e52b87f59ee2afe3415361c6ec35e665924eb08afe8ff159"
193
+"checksum fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "43f3795b4bae048dc6123a6b972cadde2e676f9ded08aef6bb77f5f157684a82"
194
+"checksum futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "118b49cac82e04121117cbd3121ede3147e885627d82c4546b87c702debb90c1"
195
+"checksum iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6e8b9c2247fcf6c6a1151f1156932be5606c9fd6f55a2d7f9fc1cb29386b2f7"
196
+"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
197
+"checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b"
198
+"checksum libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)" = "36fbc8a8929c632868295d0178dd8f63fc423fd7537ad0738372bd010b3ac9b0"
199
+"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b"
200
+"checksum mio 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0e8411968194c7b139e9105bc4ae7db0bae232af087147e72f0616ebf5fdb9cb"
201
+"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
202
+"checksum net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "3a80f842784ef6c9a958b68b7516bc7e35883c614004dd94959a4dca1b716c09"
203
+"checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
204
+"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
205
+"checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d"
206
+"checksum tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c843a027f7c1df5f81e7734a0df3f67bf329411781ebf36393ce67beef6071e3"
207
+"checksum tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "514aae203178929dbf03318ad7c683126672d4d96eccb77b29603d33c9e25743"
208
+"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
209
+"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
210
+"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"

+ 8
- 0
Cargo.toml Visa fil

@@ -0,0 +1,8 @@
1
+[package]
2
+name = "futuretest"
3
+version = "0.1.0"
4
+authors = ["Mahmoud Al-Qudsi <mqudsi@neosmart.net>"]
5
+
6
+[dependencies]
7
+futures = "*"
8
+tokio-core = "*"

+ 20
- 0
src/main.rs Visa fil

@@ -0,0 +1,20 @@
1
+extern crate futures;
2
+extern crate tokio_core;
3
+use futures::future::{self};
4
+use futures::future::*;
5
+use tokio_core::reactor::Core;
6
+
7
+fn main() {
8
+    let mut core = Core::new().expect("Failed to initialize tokio_core reactor!");
9
+
10
+    let f = future::result(Ok(()))
11
+        .map_err(|()| "&'static str error")
12
+        .and_then(|_|
13
+             future::result(Ok(())
14
+                .map_err(|()| "String error".to_owned())
15
+            )
16
+        )
17
+    ;
18
+
19
+    core.run(f).unwrap();
20
+}

Laddar…
Avbryt
Spara