chris-morgan / rust-http

Completely OBSOLETE Rust HTTP library (server and client)
Other
390 stars 110 forks source link

Build failed with error - mismatched types: expected `collections::string::String`, found `time::TmFmt<'_>` #170

Closed afiskon closed 9 years ago

afiskon commented 9 years ago
eax@fujitsu:~/temp$ git clone https://github.com/chris-morgan/rust-http
Cloning into 'rust-http'...
remote: Counting objects: 3860, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 3860 (delta 1), reused 0 (delta 0)
Receiving objects: 100% (3860/3860), 999.52 KiB | 210.00 KiB/s, done.
Resolving deltas: 100% (2186/2186), done.
Checking connectivity... done.
eax@fujitsu:~/temp$ cd rust-http/
eax@fujitsu:~/temp/rust-http$ ls
Cargo.toml  codegen  comparisons  COPYRIGHT  documentation  examples  LICENSE-APACHE  LICENSE-MIT  prebuild.sh  README.rst  src
eax@fujitsu:~/temp/rust-http$ cargo build -v
warning: an arbitrary build command has now been deprecated.
         It has been replaced by custom build scripts.
         For more information, see http://doc.crates.io/build-script.html
    Updating git repository `https://github.com/sfackler/rust-openssl.git`
    Updating git repository `https://github.com/servo/rust-url`
    Updating git repository `https://github.com/lifthrasiir/rust-encoding`
   Compiling encoding-index-japanese v1.0.20140915 (https://github.com/lifthrasiir/rust-encoding#a06637cc)
     Running `rustc lib.rs --crate-name encoding-index-japanese --crate-type lib -g -C metadata=483043e85d4a33ad -C extra-filename=-483043e85d4a33ad --out-dir /home/eax/temp/rust-http/target/deps --dep-info /home/eax/temp/rust-http/target/.fingerprint/encoding-index-japanese-483043e85d4a33ad/dep-lib-encoding-index-japanese -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/deps -Awarnings`
   Compiling encoding-index-singlebyte v1.0.20140915 (https://github.com/lifthrasiir/rust-encoding#a06637cc)
     Running `rustc lib.rs --crate-name encoding-index-singlebyte --crate-type lib -g -C metadata=bea7b3e2495b3c3b -C extra-filename=-bea7b3e2495b3c3b --out-dir /home/eax/temp/rust-http/target/deps --dep-info /home/eax/temp/rust-http/target/.fingerprint/encoding-index-singlebyte-bea7b3e2495b3c3b/dep-lib-encoding-index-singlebyte -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/deps -Awarnings`
   Compiling openssl v0.0.0 (https://github.com/sfackler/rust-openssl.git#766ce4b7)
     Running `rustc src/lib.rs --crate-name openssl --crate-type lib -g -C metadata=fbe75530f7eda428 -C extra-filename=-fbe75530f7eda428 --out-dir /home/eax/temp/rust-http/target/deps --dep-info /home/eax/temp/rust-http/target/.fingerprint/openssl-fbe75530f7eda428/dep-lib-openssl -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/deps -Awarnings`
   Compiling encoding-index-korean v1.0.20140915 (https://github.com/lifthrasiir/rust-encoding#a06637cc)
     Running `rustc lib.rs --crate-name encoding-index-korean --crate-type lib -g -C metadata=deaa17992fade0b3 -C extra-filename=-deaa17992fade0b3 --out-dir /home/eax/temp/rust-http/target/deps --dep-info /home/eax/temp/rust-http/target/.fingerprint/encoding-index-korean-deaa17992fade0b3/dep-lib-encoding-index-korean -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/deps -Awarnings`
   Compiling encoding-index-simpchinese v1.0.20140915 (https://github.com/lifthrasiir/rust-encoding#a06637cc)
     Running `rustc lib.rs --crate-name encoding-index-simpchinese --crate-type lib -g -C metadata=2dc900f172f1b6eb -C extra-filename=-2dc900f172f1b6eb --out-dir /home/eax/temp/rust-http/target/deps --dep-info /home/eax/temp/rust-http/target/.fingerprint/encoding-index-simpchinese-2dc900f172f1b6eb/dep-lib-encoding-index-simpchinese -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/deps -Awarnings`
   Compiling encoding-index-tradchinese v1.0.20140915 (https://github.com/lifthrasiir/rust-encoding#a06637cc)
     Running `rustc lib.rs --crate-name encoding-index-tradchinese --crate-type lib -g -C metadata=31c5a3802fca9dba -C extra-filename=-31c5a3802fca9dba --out-dir /home/eax/temp/rust-http/target/deps --dep-info /home/eax/temp/rust-http/target/.fingerprint/encoding-index-tradchinese-31c5a3802fca9dba/dep-lib-encoding-index-tradchinese -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/deps -Awarnings`
   Compiling http v0.1.0-pre (file:///home/eax/temp/rust-http)
     Running sh prebuild.sh
   Compiling encoding v0.2.0 (https://github.com/lifthrasiir/rust-encoding#a06637cc)
     Running `rustc /home/eax/.cargo/git/checkouts/rust-encoding-aceee0e55a114022/master/src/lib.rs --crate-name encoding --crate-type lib -g -C metadata=8745cc083d450456 -C extra-filename=-8745cc083d450456 --out-dir /home/eax/temp/rust-http/target/deps --dep-info /home/eax/temp/rust-http/target/.fingerprint/encoding-8745cc083d450456/dep-lib-encoding -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/deps --extern encoding-index-simpchinese=/home/eax/temp/rust-http/target/deps/libencoding-index-simpchinese-2dc900f172f1b6eb.rlib --extern encoding-index-korean=/home/eax/temp/rust-http/target/deps/libencoding-index-korean-deaa17992fade0b3.rlib --extern encoding-index-tradchinese=/home/eax/temp/rust-http/target/deps/libencoding-index-tradchinese-31c5a3802fca9dba.rlib --extern encoding-index-japanese=/home/eax/temp/rust-http/target/deps/libencoding-index-japanese-483043e85d4a33ad.rlib --extern encoding-index-singlebyte=/home/eax/temp/rust-http/target/deps/libencoding-index-singlebyte-bea7b3e2495b3c3b.rlib -Awarnings`
   Compiling url v0.1.0 (https://github.com/servo/rust-url#8a61b765)
     Running `rustc /home/eax/.cargo/git/checkouts/rust-url-1e22af4233079a1e/master/src/lib.rs --crate-name url --crate-type lib -g -C metadata=921578b148f50e06 -C extra-filename=-921578b148f50e06 --out-dir /home/eax/temp/rust-http/target/deps --dep-info /home/eax/temp/rust-http/target/.fingerprint/url-921578b148f50e06/dep-lib-url -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/deps --extern encoding=/home/eax/temp/rust-http/target/deps/libencoding-8745cc083d450456.rlib -Awarnings`
     Running `rustc src/http/lib.rs --crate-name http --crate-type lib -g -C metadata=75bda6d0676a064c -C extra-filename=-75bda6d0676a064c --out-dir /home/eax/temp/rust-http/target --dep-info /home/eax/temp/rust-http/target/.fingerprint/http-75bda6d0676a064c/dep-lib-http -L /home/eax/temp/rust-http/target -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/native/http-75bda6d0676a064c --extern openssl=/home/eax/temp/rust-http/target/deps/libopenssl-fbe75530f7eda428.rlib --extern url=/home/eax/temp/rust-http/target/deps/liburl-921578b148f50e06.rlib`
src/http/headers/mod.rs:733:9: 733:63 error: mismatched types: expected `collections::string::String`, found `time::TmFmt<'_>` (expected struct collections::string::String, found struct time::TmFmt)
src/http/headers/mod.rs:733         self.to_utc().strftime("%a, %d %b %Y %T GMT").unwrap()
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `http`.

Caused by:
  Process didn't exit successfully: `rustc src/http/lib.rs --crate-name http --crate-type lib -g -C metadata=75bda6d0676a064c -C extra-filename=-75bda6d0676a064c --out-dir /home/eax/temp/rust-http/target --dep-info /home/eax/temp/rust-http/target/.fingerprint/http-75bda6d0676a064c/dep-lib-http -L /home/eax/temp/rust-http/target -L /home/eax/temp/rust-http/target/deps -L /home/eax/temp/rust-http/target/native/http-75bda6d0676a064c --extern openssl=/home/eax/temp/rust-http/target/deps/libopenssl-fbe75530f7eda428.rlib --extern url=/home/eax/temp/rust-http/target/deps/liburl-921578b148f50e06.rlib` (status=101)
eax@fujitsu:~/temp/rust-http$ rustc --version
rustc 0.13.0-nightly
eax@fujitsu:~/temp/rust-http$ cargo --version
cargo 0.0.1-pre-nightly (8cc600a 2014-11-07 21:15:52 +0000)
eax@fujitsu:~/temp/rust-http$ uname -a
Linux fujitsu 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
eax@fujitsu:~/temp/rust-http$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
erinzm commented 9 years ago

I can reproduce this issue, see https://travis-ci.org/MadCityFolders/registrator/builds/40465856#L118. This probably became a problem on the latest nightly of Rust.

schickling commented 9 years ago

Same here. The latest nightly builds as docker images can btw found here: https://registry.hub.docker.com/u/schickling/rust/

erinzm commented 9 years ago

Heh, two people fixed it at about the same time :smiley:

Ogeon commented 9 years ago

Silly situation, but whatever. The problem was just an API change and it was resolved by converting the result to a string.

schickling commented 9 years ago

Thanks for the fast fix!