Closed
Description
Code
#[no_mangle]
pub extern "C" fn double(x: i32) -> i32 {
x * 2
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn double_test() {
assert_eq!(double(2), 4);
}
}
Meta
rustc --version --verbose
:
rustc 1.52.0-nightly (107896c32 2021-03-15)
binary: rustc
commit-hash: 107896c32d5dda4db508968ff34997a39d286966
commit-date: 2021-03-15
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0
Error output
cargo test
Compiling patientprovider v0.1.0 (/home/arif/rust/patientprovider)
thread 'rustc' panicked at 'found unstable fingerprints for predicates_of(core[3998]::cmp::PartialEq)', /rustc/107896c32d5dda4db508968ff34997a39d286966/compiler/rustc_query_system/src/query/plumbing.rs:593:5
Backtrace
stack backtrace:
0: rust_begin_unwind
at /rustc/107896c32d5dda4db508968ff34997a39d286966/library/std/src/panicking.rs:493:5
1: std::panicking::begin_panic_fmt
at /rustc/107896c32d5dda4db508968ff34997a39d286966/library/std/src/panicking.rs:435:5
2: rustc_query_system::query::plumbing::incremental_verify_ich
3: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
4: rustc_query_system::query::plumbing::get_query_impl
5: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::predicates_of
6: rustc_middle::ty::generics::GenericPredicates::instantiate_into
7: rustc_middle::ty::generics::GenericPredicates::instantiate
8: rustc_typeck::check::method::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::lookup_method_in_trait
9: rustc_typeck::check::op::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::lookup_op_method
10: rustc_typeck::check::op::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_overloaded_binop
11: rustc_typeck::check::op::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_binop
12: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
13: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
14: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
15: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
16: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
17: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
18: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
19: rustc_typeck::check::_match::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_match
20: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
21: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
22: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
23: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
24: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt
25: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
26: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
27: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_return_expr
28: rustc_typeck::check::check::check_fn
29: rustc_infer::infer::InferCtxtBuilder::enter
30: rustc_typeck::check::typeck
31: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
32: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
33: rustc_query_system::query::plumbing::force_query_with_job
34: rustc_query_system::query::plumbing::get_query_impl
35: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
36: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
37: rustc_typeck::check::typeck_item_bodies
38: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
39: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
40: rustc_data_structures::stack::ensure_sufficient_stack
41: rustc_query_system::query::plumbing::force_query_with_job
42: rustc_query_system::query::plumbing::get_query_impl
43: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
44: rustc_session::utils::<impl rustc_session::session::Session>::time
45: rustc_typeck::check_crate
46: rustc_interface::passes::analysis
47: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
48: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
49: rustc_data_structures::stack::ensure_sufficient_stack
50: rustc_query_system::query::plumbing::force_query_with_job
51: rustc_query_system::query::plumbing::get_query_impl
52: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
53: rustc_interface::passes::QueryContext::enter
54: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
55: rustc_span::with_source_map
56: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Note, this bug does not exist in stable:
rustc 1.49.0 (e1884a8e3 2020-12-29)
binary: rustc
commit-hash: e1884a8e3c3e813aada8254edfa120e85bf5ffca
commit-date: 2020-12-29
host: x86_64-unknown-linux-gnu
release: 1.49.0
And in any case only occurs under cargo test
, not cargo build