Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc crashes with exit code 101 and no error - 2018 edition + futures-await + automatic extern crate #51975

Closed
Arnavion opened this issue Jul 1, 2018 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-rust-2018-preview Area: The 2018 edition preview
Milestone

Comments

@Arnavion
Copy link

Arnavion commented Jul 1, 2018

$ rustc -vV

rustc 1.28.0-nightly (84804c387 2018-06-26)
binary: rustc
commit-hash: 84804c3874a15f55a905c0b53d820372003b0c24
commit-date: 2018-06-26
host: x86_64-pc-windows-msvc
release: 1.28.0-nightly
LLVM version: 6.0

Cargo.toml

cargo-features = ["edition"]

[package]
name = "rust-test"
version = "0.1.0"
authors = ["Arnavion <arnavion@gmail.com>"]
edition = "2018"

[dependencies]
futures-await = "0.1.x"

Cargo.lock

[[package]]
name = "futures"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "futures-await"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
 "futures-await-async-macro 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
 "futures-await-await-macro 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "futures-await-async-macro"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
 "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
 "syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "futures-await-await-macro"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "proc-macro2"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "quote"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "rust-test"
version = "0.1.0"
dependencies = [
 "futures-await 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "syn"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
 "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[metadata]
"checksum futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "1a70b146671de62ec8c8ed572219ca5d594d9b06c0b364d5e67b722fc559b48c"
"checksum futures-await 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d76972f0c250aadc9c3e521023e769b097f838a2d9a71e5139c4fdf0c7657463"
"checksum futures-await-async-macro 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fdd257a06a5fd1f31adcbddb8068678b2ae534fb6eb282df010ae41db59ddf84"
"checksum futures-await-await-macro 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3b8bd34e4f4d1bf0e3fe3f22ad22475429f594221472216e34b942f912ec4a4"
"checksum proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "effdb53b25cdad54f8f48843d67398f7ef2e14f12c1b4cb4effc549a6462a4d6"
"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035"
"checksum syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2beff8ebc3658f07512a413866875adddd20f4fd47b2a4e6c9da65cd281baaea"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"

lib.rs

// extern crate futures_await;

use futures_await as futures;
use crate::futures::{ Future, IntoFuture };

fn foo() -> impl Future<Item = (), Error = ()> {
	Ok(()).into_future()
}
$ cargo build --verbose

<snip>
     Running `rustc --edition=2018 --crate-name rust_test src\lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=dab8a58d770a200f -C extra-filename=-dab8a58d770a200f --out-dir C:\Stuff\Sources\rust-test\target\debug\deps -C linker=lld-link -C incremental=C:\Stuff\Sources\rust-test\target\debug\incremental -L dependency=C:\Stuff\Sources\rust-test\target\debug\deps --extern futures_await=C:\Stuff\Sources\rust-test\target\debug\deps\libfutures_await-de83e6f62427976c.rlib -C target-feature=+crt-static`
warning: unused import: `IntoFuture`
 --> src\lib.rs:4:31
  |
4 | use crate::futures::{ Future, IntoFuture };
  |                               ^^^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

error: Could not compile `rust-test`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name rust_test src\lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=dab8a58d770a200f -C extra-filename=-dab8a58d770a200f --out-dir C:\Stuff\Sources\rust-test\target\debug\deps -C linker=lld-link -C incremental=C:\Stuff\Sources\rust-test\target\debug\incremental -L dependency=C:\Stuff\Sources\rust-test\target\debug\deps --extern futures_await=C:\Stuff\Sources\rust-test\target\debug\deps\libfutures_await-de83e6f62427976c.rlib -C target-feature=+crt-static` (exit code: 101)
  • Uncommenting the extern crate futures_await; line makes it compile successfully.

  • Using the futures 0.1.x crate directly instead of futures_await compiles successfully, without needing to add an extern crate futures; line.

@stokhos stokhos added A-rust-2018-preview Area: The 2018 edition preview A-diagnostics Area: Messages for errors, warnings, and lints labels Jul 2, 2018
@Arnavion
Copy link
Author

Arnavion commented Jul 2, 2018

It seems rustc doesn't like the use futures_await as futures; if there is no extern crate futures_await; Replacing it with

mod futures {
	pub use futures_await::*;
}

compiles fine.

Perhaps the original code isn't actually supposed to compile with edition 2018, and the bug is just a missing error message?

@aturon
Copy link
Member

aturon commented Jul 31, 2018

cc @petrochenkov

@eddyb
Copy link
Member

eddyb commented Sep 6, 2018

Can't reproduce on nightly. Can you confirm this, @Arnavion?
(I suspect #52923 fixed this by replacing "the finalize_import hack")

@Arnavion
Copy link
Author

Arnavion commented Sep 6, 2018

Looks like it. rustc 1.30.0-nightly (6e0f1cc15 2018-09-05) compiles it successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-rust-2018-preview Area: The 2018 edition preview
Projects
None yet
Development

No branches or pull requests

5 participants