rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.27k stars 12.58k forks source link

Compiler panic while building alga #48542

Closed rocurley closed 6 years ago

rocurley commented 6 years ago
I tried this code: ``` git clone git@github.com:sebcrozet/alga.git cd alga export RUST_BACKTRACE=full cargo build --verbose ``` I expected to see this happen: Alga builds successfully, or fails to build with compile errors. Instead, this happened: The compiler panicked. ## Meta `rustc --version --verbose`: ``` rustc 1.26.0-nightly (322d7f7b9 2018-02-25) binary: rustc commit-hash: 322d7f7b97f1672bade31e1c43d5753e0e45a1a8 commit-date: 2018-02-25 host: x86_64-unknown-linux-gnu release: 1.26.0-nightly LLVM version: 6.0 ``` Backtrace: ``` Fresh unicode-xid v0.0.4 Fresh num-traits v0.2.0 Fresh cfg-if v0.1.2 Fresh utf8-ranges v0.1.3 Fresh approx v0.1.1 Fresh regex-syntax v0.3.9 Fresh rustc-serialize v0.3.24 Fresh winapi v0.2.8 Fresh libc v0.2.36 Fresh winapi-build v0.1.1 Fresh quote v0.3.15 Fresh edit-distance v1.0.0 Fresh synom v0.11.3 Fresh num-traits v0.1.43 Fresh log v0.4.1 Fresh num-complex v0.1.42 Fresh memchr v0.1.11 Fresh rand v0.4.2 Fresh syn v0.11.11 Compiling log v0.3.9 Compiling alga v0.5.3 (file:///home/roger/alga/alga) Running `rustc --crate-name alga alga/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=7d8a4bc96630a5c1 -C extra-filename=-7d8a4bc96630a5c1 --out-dir /home/roger/alga/target/debug/deps -C incremental=/home/roger/alga/target/debug/incremental -L dependency=/home/roger/alga/target/debug/deps --extern num_complex=/home/roger/alga/target/debug/deps/libnum_complex-070709ff52c451f1.rlib --extern approx=/home/roger/alga/target/debug/deps/libapprox-c539f28333436395.rlib --extern num_traits=/home/roger/alga/target/debug/deps/libnum_traits-40976005af172ca0.rlib` Running `rustc --crate-name log /home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.3.9/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="log"' --cfg 'feature="use_std"' -C metadata=744c229531176343 -C extra-filename=-744c229531176343 --out-dir /home/roger/alga/target/debug/deps -L dependency=/home/roger/alga/target/debug/deps --extern log=/home/roger/alga/target/debug/deps/liblog-5e7b6585e95ec20d.rlib --cap-lints allow` warning: unused macro definition --> alga/src/macros.rs:143:1 | 143 | / macro_rules! impl_approx_eq { 144 | | ($V:expr; $($T:ty),* $(,)*) => { 145 | | $(impl ApproxEq for $T { 146 | | type Eps = $T; ... | 158 | | } 159 | | } | |_^ | = note: #[warn(unused_macros)] on by default warning: unused macro definition --> alga/src/general/one_operator.rs:84:1 | 84 | / macro_rules! impl_quasigroup( 85 | | (<$M:ty> for $($T:tt)+) => { 86 | | impl_marker!($crate::general::AbstractQuasigroup<$M>; $($T)+); 87 | | } 88 | | ); | |__^ warning: unused macro definition --> alga/src/general/one_operator.rs:182:1 | 182 | / macro_rules! impl_loop( 183 | | (<$M:ty> for $($T:tt)+) => { 184 | | impl_quasigroup!(<$M> for $($T)+); 185 | | impl_marker!($crate::general::AbstractLoop<$M>; $($T)+); 186 | | } 187 | | ); | |__^ thread 'rustc' panicked at 'assertion failed: `(left != right)` left: `ParamEnv(Binder(ProjectionPredicate(ProjectionTy { substs: Slice([::Coordinates, ::Real]), item_def_id: DefId(2/0:893 ~ core[ffe9]::ops[0]::arith[0]::Mul[0]::Output[0]) }, ::Coordinates)))`, right: `ParamEnv(Binder(ProjectionPredicate(ProjectionTy { substs: Slice([::Coordinates, ::Real]), item_def_id: DefId(2/0:893 ~ core[ffe9]::ops[0]::arith[0]::Mul[0]::Output[0]) }, ::Coordinates)))`', librustc/traits/project.rs:146:17 stack backtrace: Fresh aho-corasick v0.5.3 Compiling rand v0.3.22 Running `rustc --crate-name rand /home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.22/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=cdfe1b40051a65c0 -C extra-filename=-cdfe1b40051a65c0 --out-dir /home/roger/alga/target/debug/deps -L dependency=/home/roger/alga/target/debug/deps --extern libc=/home/roger/alga/target/debug/deps/liblibc-82c069f3a2b79d60.rlib --extern rand=/home/roger/alga/target/debug/deps/librand-b4a86ac63f7e2602.rlib --cap-lints allow` 0: 0x7f1be23fc083 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hc40e1d8049414718 at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 1: 0x7f1be23f35c4 - std::sys_common::backtrace::_print::hf0e087caed6cb7b0 at libstd/sys_common/backtrace.rs:71 2: 0x7f1be23f8d0d - std::panicking::default_hook::{{closure}}::h51b503c8121f2e1c at libstd/sys_common/backtrace.rs:59 at libstd/panicking.rs:206 3: 0x7f1be23f8a09 - std::panicking::default_hook::h92f8d7a75f029a40 at libstd/panicking.rs:222 4: 0x7f1bdee728dd - core::ops::function::Fn::call::h6f1946f7b82ebda6 5: 0x7f1be23f91a9 - std::panicking::rust_panic_with_hook::hd9e2db57fe6c41ab at libstd/panicking.rs:401 6: 0x7f1be23f8f92 - std::panicking::begin_panic_fmt::he73ce2d8bf11fd27 at libstd/panicking.rs:347 7: 0x7f1bdf1847e2 - rustc::traits::project::ProjectionTyCandidateSet::push_candidate::ha024fea861181222 8: 0x7f1bdf188dd2 - rustc::traits::project::opt_normalize_projection_type::h02002e97c58b49f0 9: 0x7f1bdf187d43 - rustc::traits::project::normalize_projection_type::h5e7902796a371a8d 10: 0x7f1bdf18762c - as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty::he381d91bc09bdb67 11: 0x7f1bdf20e43a - rustc::ty::subst:: for &'tcx rustc::ty::Slice>>::super_fold_with::ha71b815487303d31 12: 0x7f1bdf235bae - rustc::ty::structural_impls:: for rustc::ty::Predicate<'tcx>>::super_fold_with::hea4902f777d2175b 13: 0x7f1bdf1b429c - rustc::traits::structural_impls:: for rustc::traits::Obligation<'tcx, O>>::super_fold_with::h1ba5b2b2fe1621e4 14: 0x7f1bdf186a22 - rustc::traits::project::normalize_with_depth::hf81b47cb9116b1c3 15: 0x7f1bdf211c42 - rustc::ty::wf::WfPredicates::normalize::{{closure}}::h71ad22c86f3c0522 16: 0x7f1bdefd6999 - as core::iter::iterator::Iterator>::next::h94fe5fc1c26c92de 17: 0x7f1bdee603d7 - >::extend_desugared::h8b4f0c1acfe220ed 18: 0x7f1bdefccbd2 - as alloc::vec::SpecExtend>::from_iter::h6837c8edade6e005 19: 0x7f1bdf211a34 - rustc::ty::wf::predicate_obligations::h9c1277faf834c873 20: 0x7f1be10945b3 - rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor::check_where_clauses::h1041071718cea538 21: 0x7f1be108c8d3 - rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor::check_item_well_formed::hf288ce8ced63b0b9 22: 0x7f1be10957a8 - as rustc::hir::intravisit::Visitor<'v>>::visit_item::h1c404553f56c4f6d 23: 0x7f1be10fda88 - rustc_typeck::check_crate::{{closure}}::he4ecaea81fbca6c0 24: 0x7f1be10f979c - rustc_typeck::check_crate::ha126f305510d32a8 25: 0x7f1be27454c9 - rustc::ty::context::TyCtxt::create_and_enter::hd9afe302f04a8060 26: 0x7f1be27a652e - rustc_driver::driver::compile_input::hf08ee19e2779d9bb 27: 0x7f1be27c2c5a - rustc_driver::run_compiler::hb8a2a908a67aef0b 28: 0x7f1be26ee6ea - std::sys_common::backtrace::__rust_begin_short_backtrace::hf2003ffe9c7c219d 29: 0x7f1be2411c6e - __rust_maybe_catch_panic at libpanic_unwind/lib.rs:102 30: 0x7f1be2727936 - >::call_box::h6eec575c3921fe72 31: 0x7f1be240902b - std::sys::unix::thread::Thread::new::thread_start::h2d04eaf7b6bb3a88 at /checkout/src/liballoc/boxed.rs:793 at libstd/sys_common/thread.rs:24 at libstd/sys/unix/thread.rs:90 32: 0x7f1bdd2f76b9 - start_thread 33: 0x7f1be20ca3dc - clone 34: 0x0 - Compiling compiletest_rs v0.2.10 Running `rustc --crate-name compiletest_rs /home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.2.10/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=afc0fa449a30a718 -C extra-filename=-afc0fa449a30a718 --out-dir /home/roger/alga/target/debug/deps -L dependency=/home/roger/alga/target/debug/deps --extern rustc_serialize=/home/roger/alga/target/debug/deps/librustc_serialize-b181cb2d64ae0c9e.rlib --extern log=/home/roger/alga/target/debug/deps/liblog-744c229531176343.rlib --cap-lints allow` error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: rustc 1.26.0-nightly (322d7f7b9 2018-02-25) running on x86_64-unknown-linux-gnu error: Could not compile `alga`. Caused by: process didn't exit successfully: `rustc --crate-name alga alga/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=7d8a4bc96630a5c1 -C extra-filename=-7d8a4bc96630a5c1 --out-dir /home/roger/alga/target/debug/deps -C incremental=/home/roger/alga/target/debug/incremental -L dependency=/home/roger/alga/target/debug/deps --extern num_complex=/home/roger/alga/target/debug/deps/libnum_complex-070709ff52c451f1.rlib --extern approx=/home/roger/alga/target/debug/deps/libapprox-c539f28333436395.rlib --extern num_traits=/home/roger/alga/target/debug/deps/libnum_traits-40976005af172ca0.rlib` (exit code: 101) warning: build failed, waiting for other jobs to finish... error[E0432]: unresolved import `test::TestPaths` --> /home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.2.10/src/lib.rs:34:5 | 34 | use test::TestPaths; | ^^^^^^^^^^^^^^^ no `TestPaths` in the root. Did you mean to use `TestOpts`? error[E0432]: unresolved import `test::TestPaths` --> /home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.2.10/src/runtest.rs:20:5 | 20 | use test::TestPaths; | ^^^^^^^^^^^^^^^ no `TestPaths` in the root. Did you mean to use `TestOpts`? error[E0560]: struct `test::TestOpts` has no field named `quiet` --> /home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.2.10/src/lib.rs:100:9 | 100 | quiet: config.quiet, | ^^^^^^ `test::TestOpts` does not have this field | = note: available fields are: `list`, `filter`, `filter_exact`, `run_ignored`, `run_tests` ... and 8 others error[E0593]: closure is expected to take 0 arguments, but it takes a single 0-tuple as argument --> /home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.2.10/src/lib.rs:263:21 | 263 | test::DynTestFn(Box::new(move |()| { | ^ --------- takes a single 0-tuple as argument | _____________________| | | 264 | | runtest::run(config, &testpaths) 265 | | })) | |______^ expected closure that takes 0 arguments | = note: required because of the requirements on the impl of `std::boxed::FnBox<()>` for `[closure@/home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.2.10/src/lib.rs:263:30: 265:6 config:_, testpaths:_]` = note: required for the cast to the object type `std::boxed::FnBox<(), Output=()> + std::marker::Send` help: change the closure to take multiple arguments instead of a single tuple | 263 | test::DynTestFn(Box::new(|| { | ^^ error: aborting due to 4 previous errors error: Could not compile `compiletest_rs`. Caused by: process didn't exit successfully: `rustc --crate-name compiletest_rs /home/roger/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.2.10/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=afc0fa449a30a718 -C extra-filename=-afc0fa449a30a718 --out-dir /home/roger/alga/target/debug/deps -L dependency=/home/roger/alga/target/debug/deps --extern rustc_serialize=/home/roger/alga/target/debug/deps/librustc_serialize-b181cb2d64ae0c9e.rlib --extern log=/home/roger/alga/target/debug/deps/liblog-744c229531176343.rlib --cap-lints allow` (exit code: 101) ```
Antti commented 6 years ago

I have the same issue. I think it might be related to https://github.com/rust-lang/rust/pull/48296

rustc 1.26.0-nightly (322d7f7b9 2018-02-25)
binary: rustc
commit-hash: 322d7f7b97f1672bade31e1c43d5753e0e45a1a8
commit-date: 2018-02-25
host: x86_64-apple-darwin
release: 1.26.0-nightly
LLVM version: 6.0
ishitatsuyuki commented 6 years ago

Duplicate of #48551, I'm currently investigating.