rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
6.06k stars 892 forks source link

build failure with latest nightly #2282

Closed matthiaskrgr closed 6 years ago

matthiaskrgr commented 6 years ago
rustc 1.24.0-nightly (0077d128d 2017-12-14)
       Fresh backtrace v0.3.4
       Fresh error-chain v0.11.0
       Fresh cargo_metadata v0.3.3
   Compiling rustfmt-nightly v0.3.1 (file:///home/matthias/vcs/github/rustfmt)
     Running `rustc --crate-name rustfmt_nightly src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="cargo-fmt"' --cfg 'feature="default"' --cfg 'feature="rustfmt-format-diff"' -C metadata=351f993f20fa3952 -C extra-filename=-351f993f20fa3952 --out-dir /home/matthias/vcs/github/rustfmt/target/debug/deps -L dependency=/home/matthias/vcs/github/rustfmt/target/debug/deps --extern cargo_metadata=/home/matthias/vcs/github/rustfmt/target/debug/deps/libcargo_metadata-e2b11573877e8fda.rlib --extern env_logger=/home/matthias/vcs/github/rustfmt/target/debug/deps/libenv_logger-ef2c91f4d41a04c3.rlib --extern regex=/home/matthias/vcs/github/rustfmt/target/debug/deps/libregex-7c9462cb38c1ead9.rlib --extern unicode_segmentation=/home/matthias/vcs/github/rustfmt/target/debug/deps/libunicode_segmentation-eb0956335eab8b88.rlib --extern serde=/home/matthias/vcs/github/rustfmt/target/debug/deps/libserde-740b89012ee21321.rlib --extern getopts=/home/matthias/vcs/github/rustfmt/target/debug/deps/libgetopts-7e211a2f44f0072d.rlib --extern derive_new=/home/matthias/vcs/github/rustfmt/target/debug/deps/libderive_new-124b780ab0877cd4.so --extern log=/home/matthias/vcs/github/rustfmt/target/debug/deps/liblog-e0fbe19557d2222d.rlib --extern diff=/home/matthias/vcs/github/rustfmt/target/debug/deps/libdiff-8c1cf7c8e01530d0.rlib --extern libc=/home/matthias/vcs/github/rustfmt/target/debug/deps/liblibc-38e3b7891dbf246c.rlib --extern serde_derive=/home/matthias/vcs/github/rustfmt/target/debug/deps/libserde_derive-d61274fcb8bc107b.so --extern term=/home/matthias/vcs/github/rustfmt/target/debug/deps/libterm-0d6c34c7479642ce.rlib --extern toml=/home/matthias/vcs/github/rustfmt/target/debug/deps/libtoml-2bf6e0705976f2de.rlib --extern serde_json=/home/matthias/vcs/github/rustfmt/target/debug/deps/libserde_json-981f14a7773bbbf2.rlib -C target-cpu=native -L native=/home/matthias/vcs/github/rustfmt/target/debug/build/backtrace-sys-1558d403d38a5e38/out/.libs`
error[E0308]: mismatched types
   --> src/lib.rs:509:66
    |
509 |                 parse::new_parser_from_source_str(parse_session, "stdin".to_owned(), text);
    |                                                                  ^^^^^^^^^^^^^^^^^^ expected enum `syntax::codemap::FileName`, found struct `std::string::String`
    |
    = note: expected type `syntax::codemap::FileName`
               found type `std::string::String`
help: try using a variant of the expected type
    |
509 |                 parse::new_parser_from_source_str(parse_session, syntax::codemap::FileName::Macros("stdin".to_owned()), text);
    |                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
509 |                 parse::new_parser_from_source_str(parse_session, syntax::codemap::FileName::Custom("stdin".to_owned()), text);
    |                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no method named `as_str` found for type `syntax::codemap::FileName` in the current scope
  --> src/codemap.rs:29:33
   |
29 |         self.file.as_ref().name.as_str()
   |                                 ^^^^^^

error[E0308]: mismatched types
   --> src/missed_spans.rs:169:17
    |
169 |                 file_name,
    |                 ^^^^^^^^^ expected str, found enum `syntax::codemap::FileName`
    |
    = note: expected type `&str`
               found type `&syntax::codemap::FileName`

error[E0308]: mismatched types
   --> src/missed_spans.rs:190:83
    |
190 |                 self.process_missing_code(&mut status, snippet, subslice, offset, file_name);
    |                                                                                   ^^^^^^^^^ expected str, found enum `syntax::codemap::FileName`
    |
    = note: expected type `&str`
               found type `&syntax::codemap::FileName`

error[E0277]: the trait bound `std::path::PathBuf: serde::export::From<syntax::codemap::FileName>` is not satisfied
  --> src/modules.rs:28:71
   |
28 |     let root_filename: PathBuf = codemap.span_to_filename(krate.span).into();
   |                                                                       ^^^^ the trait `serde::export::From<syntax::codemap::FileName>` is not implemented for `std::path::PathBuf`
   |
   = help: the following implementations were found:
             <std::path::PathBuf as serde::export::From<std::boxed::Box<std::path::Path>>>
             <std::path::PathBuf as serde::export::From<std::string::String>>
             <std::path::PathBuf as serde::export::From<&'a T>>
             <std::path::PathBuf as serde::export::From<std::ffi::OsString>>
   = note: required because of the requirements on the impl of `serde::export::Into<std::path::PathBuf>` for `syntax::codemap::FileName`

error: aborting due to 5 previous errors

error: Could not compile `rustfmt-nightly`.
topecongiro commented 6 years ago

Published 0.3.2.