rust-lang / rust

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

unexpected panic: [predicates_of] computing predicates of `std::clone::Clone` #87409

Closed PLDreyer closed 1 year ago

PLDreyer commented 3 years ago

Hey guys, I'm new to rust and while playing around with it I may have stumbled across a bug (at least that's what the compiler says). I made the repository public and created a branch.

If I can be of any further help please let me know

Code

https://github.com/PLDreyer/TwoFa/tree/compiler-bug https://github.com/PLDreyer/TwoFa/blob/compiler-bug/src/main.rs#L50

    let opts: Opts = Opts::parse();
    let logger: Logger = Logger::new(opts.debug.clone());

    let action = &opts.action.clone();
    let application = &opts.application.clone();

Meta

rustc --version --verbose:

rustc 1.52.0 (88f19c6da 2021-05-03)
binary: rustc
commit-hash: 88f19c6dab716c6281af7602e30f413e809c5974
commit-date: 2021-05-03
host: x86_64-unknown-linux-gnu
release: 1.52.0
LLVM version: 12.0.0

Error output

thread 'rustc' panicked at 'found unstable fingerprints for predicates_of(core[b0ed]::clone::Clone): GenericPredicates { parent: None, predicates: [(Binder(TraitPredicate(<Self as std::marker::Sized>)), /home/pauld/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:108:18: 108:23 (#0)), (Binder(TraitPredicate(<Self as std::clone::Clone>)), /home/pauld/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:108:1: 108:23 (#0))] }', /rustc/88f19c6dab716c6281af7602e30f413e809c5974/compiler/rustc_query_system/src/query/plumbing.rs:593:5
Backtrace

``` stack backtrace: 0: rust_begin_unwind at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:493:5 1: std::panicking::begin_panic_fmt at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/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: ::predicates_of 6: rustc_middle::ty::generics::GenericPredicates::instantiate_into 7: rustc_middle::ty::generics::GenericPredicates::instantiate 8: rustc_typeck::check::method::confirm::ConfirmContext::confirm 9: rustc_typeck::check::method::::lookup_method 10: rustc_typeck::check::expr::::check_expr_kind 11: rustc_typeck::check::expr::::check_expr_with_expectation 12: rustc_typeck::check::fn_ctxt::checks::::check_argument_types 13: rustc_typeck::check::callee::::confirm_builtin_call 14: rustc_typeck::check::callee::::check_call 15: rustc_typeck::check::expr::::check_expr_kind 16: rustc_typeck::check::expr::::check_expr_with_expectation 17: rustc_typeck::check::fn_ctxt::checks::::check_decl_initializer 18: rustc_typeck::check::fn_ctxt::checks::::check_decl_local 19: rustc_typeck::check::fn_ctxt::checks::::check_stmt 20: rustc_typeck::check::fn_ctxt::checks::::check_block_with_expected 21: rustc_typeck::check::expr::::check_expr_with_expectation 22: rustc_typeck::check::expr::::check_return_expr 23: rustc_typeck::check::check::check_fn 24: rustc_infer::infer::InferCtxtBuilder::enter 25: rustc_typeck::check::typeck 26: rustc_middle::dep_graph::::with_deps 27: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl 28: rustc_query_system::query::plumbing::force_query_with_job 29: rustc_query_system::query::plumbing::get_query_impl 30: ::typeck 31: rustc_middle::ty::::par_body_owners 32: rustc_typeck::check::typeck_item_bodies 33: rustc_middle::dep_graph::::with_deps 34: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl 35: rustc_data_structures::stack::ensure_sufficient_stack 36: rustc_query_system::query::plumbing::force_query_with_job 37: rustc_query_system::query::plumbing::get_query_impl 38: ::typeck_item_bodies 39: rustc_session::utils::::time 40: rustc_typeck::check_crate 41: rustc_interface::passes::analysis 42: rustc_middle::dep_graph::::with_deps 43: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl 44: rustc_data_structures::stack::ensure_sufficient_stack 45: rustc_query_system::query::plumbing::force_query_with_job 46: rustc_query_system::query::plumbing::get_query_impl 47: ::analysis 48: rustc_interface::passes::QueryContext::enter 49: rustc_interface::queries::::enter 50: rustc_span::with_source_map 51: rustc_interface::interface::create_compiler_and_run 52: scoped_tls::ScopedKey::set note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ```

PLDreyer commented 3 years ago

Fixed (workaroung) with https://github.com/rust-lang/rust/issues/84970

Aaron1011 commented 3 years ago

This should be fixed in the latest nightly.

Enselic commented 1 year ago

Triage: No one said it was not fixed, and no one said anything about a missing regression test. Closing.