aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests/coercion.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-27 10:50:08 +0100
committerGitHub <[email protected]>2020-06-27 10:50:08 +0100
commit18a6dd4635be18ebe73eb25ffa34a33f0ec8203f (patch)
tree38c2e2b9aaf1d721c8ab04b4f03ca29b27df4e85 /crates/ra_hir_ty/src/tests/coercion.rs
parentdd3f9eaceb17f5686f6377250cbe510b348af318 (diff)
parent7e104ea4a885c8fd6f348a0d7d30911fe49d91e8 (diff)
Merge #4982
4982: Bump chalk r=matklad a=lnicola This passes the tests, but fails in a weird way on `analysis-stats`: ``` thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/chalk-solve-0.14.0/src/clauses/builtin_traits/fn_family.rs:96:20 stack backtrace: 0: backtrace::backtrace::libunwind::trace at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86 1: backtrace::backtrace::trace_unsynchronized at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66 2: std::sys_common::backtrace::_print_fmt at src/libstd/sys_common/backtrace.rs:78 3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt at src/libstd/sys_common/backtrace.rs:59 4: core::fmt::write at src/libcore/fmt/mod.rs:1076 5: std::io::Write::write_fmt at src/libstd/io/mod.rs:1537 6: std::sys_common::backtrace::_print at src/libstd/sys_common/backtrace.rs:62 7: std::sys_common::backtrace::print at src/libstd/sys_common/backtrace.rs:49 8: std::panicking::default_hook::{{closure}} at src/libstd/panicking.rs:198 9: std::panicking::default_hook at src/libstd/panicking.rs:218 10: std::panicking::rust_panic_with_hook at src/libstd/panicking.rs:477 11: rust_begin_unwind at src/libstd/panicking.rs:385 12: core::panicking::panic_fmt at src/libcore/panicking.rs:86 13: core::panicking::panic at src/libcore/panicking.rs:51 14: chalk_solve::clauses::builtin_traits::fn_family::add_fn_trait_program_clauses 15: chalk_solve::clauses::builder::ClauseBuilder<I>::push_binders 16: chalk_solve::clauses::program_clauses_that_could_match 17: chalk_solve::clauses::program_clauses_for_goal 18: chalk_solve::recursive::Solver<I>::solve_new_subgoal 19: <chalk_solve::recursive::Solver<I> as chalk_solve::recursive::solve::SolveDatabase<I>>::solve_goal 20: chalk_solve::recursive::Solver<I>::solve_root_goal 21: chalk_solve::solve::Solver<I>::solve_limited 22: ra_hir_ty::traits::trait_solve_query 23: salsa::runtime::Runtime<DB>::execute_query_implementation 24: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade 25: salsa::derived::slot::Slot<DB,Q,MP>::read 26: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch 27: salsa::QueryTable<DB,Q>::get 28: <T as ra_hir_ty::db::HirDatabase>::trait_solve 29: ra_hir_ty::infer::InferenceContext::resolve_ty_as_possible 30: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner 31: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce 32: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::check_call_arguments 33: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_method_call 34: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner 35: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr 36: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_method_call 37: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner 38: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce 39: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner 40: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner 41: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce 42: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner 43: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce 44: ra_hir_ty::infer::infer_query 45: salsa::runtime::Runtime<DB>::execute_query_implementation 46: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade 47: salsa::derived::slot::Slot<DB,Q,MP>::read 48: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch 49: ra_hir_ty::db::infer_wait 50: rust_analyzer::cli::analysis_stats::analysis_stats 51: rust_analyzer::main 52: std::rt::lang_start::{{closure}} 53: std::rt::lang_start_internal::{{closure}} at src/libstd/rt.rs:52 54: std::panicking::try::do_call at src/libstd/panicking.rs:297 55: std::panicking::try at src/libstd/panicking.rs:274 56: std::panic::catch_unwind at src/libstd/panic.rs:394 57: std::rt::lang_start_internal at src/libstd/rt.rs:51 58: main 59: __libc_start_main 60: _start note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ``` It's as if we're returning `None` for a well-known trait that `chalk` asks about. That seems to happen for `Deref`, `CoerceUnsized` and `Try`. r? @flodiebold Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/tests/coercion.rs')
-rw-r--r--crates/ra_hir_ty/src/tests/coercion.rs42
1 files changed, 23 insertions, 19 deletions
diff --git a/crates/ra_hir_ty/src/tests/coercion.rs b/crates/ra_hir_ty/src/tests/coercion.rs
index a2601c68a..5a1c6ccc3 100644
--- a/crates/ra_hir_ty/src/tests/coercion.rs
+++ b/crates/ra_hir_ty/src/tests/coercion.rs
@@ -664,6 +664,8 @@ fn test() {
664fn coerce_unsize_trait_object() { 664fn coerce_unsize_trait_object() {
665 assert_snapshot!( 665 assert_snapshot!(
666 infer_with_mismatches(r#" 666 infer_with_mismatches(r#"
667#[lang = "sized"]
668pub trait Sized {}
667#[lang = "unsize"] 669#[lang = "unsize"]
668pub trait Unsize<T> {} 670pub trait Unsize<T> {}
669#[lang = "coerce_unsized"] 671#[lang = "coerce_unsized"]
@@ -689,19 +691,19 @@ fn test() {
689} 691}
690"#, true), 692"#, true),
691 @r###" 693 @r###"
692 387..572 '{ ...bj2; }': () 694 424..609 '{ ...bj2; }': ()
693 397..400 'obj': &dyn Baz<i8, i16> 695 434..437 'obj': &dyn Baz<i8, i16>
694 422..424 '&S': &S<i8, i16> 696 459..461 '&S': &S<i8, i16>
695 423..424 'S': S<i8, i16> 697 460..461 'S': S<i8, i16>
696 434..437 'obj': &dyn Bar<usize, i8, i16> 698 471..474 'obj': &dyn Bar<usize, i8, i16>
697 459..462 'obj': &dyn Baz<i8, i16> 699 496..499 'obj': &dyn Baz<i8, i16>
698 472..475 'obj': &dyn Foo<i8, usize> 700 509..512 'obj': &dyn Foo<i8, usize>
699 494..497 'obj': &dyn Bar<usize, i8, i16> 701 531..534 'obj': &dyn Bar<usize, i8, i16>
700 507..511 'obj2': &dyn Baz<i8, i16> 702 544..548 'obj2': &dyn Baz<i8, i16>
701 533..535 '&S': &S<i8, i16> 703 570..572 '&S': &S<i8, i16>
702 534..535 'S': S<i8, i16> 704 571..572 'S': S<i8, i16>
703 545..546 '_': &dyn Foo<i8, usize> 705 582..583 '_': &dyn Foo<i8, usize>
704 565..569 'obj2': &dyn Baz<i8, i16> 706 602..606 'obj2': &dyn Baz<i8, i16>
705 "### 707 "###
706 ); 708 );
707} 709}
@@ -710,6 +712,8 @@ fn test() {
710fn coerce_unsize_super_trait_cycle() { 712fn coerce_unsize_super_trait_cycle() {
711 assert_snapshot!( 713 assert_snapshot!(
712 infer_with_mismatches(r#" 714 infer_with_mismatches(r#"
715#[lang = "sized"]
716pub trait Sized {}
713#[lang = "unsize"] 717#[lang = "unsize"]
714pub trait Unsize<T> {} 718pub trait Unsize<T> {}
715#[lang = "coerce_unsized"] 719#[lang = "coerce_unsized"]
@@ -734,12 +738,12 @@ fn test() {
734} 738}
735"#, true), 739"#, true),
736 @r###" 740 @r###"
737 291..347 '{ ...obj; }': () 741 328..384 '{ ...obj; }': ()
738 301..304 'obj': &dyn D 742 338..341 'obj': &dyn D
739 315..317 '&S': &S 743 352..354 '&S': &S
740 316..317 'S': S 744 353..354 'S': S
741 327..330 'obj': &dyn A 745 364..367 'obj': &dyn A
742 341..344 'obj': &dyn D 746 378..381 'obj': &dyn D
743 "### 747 "###
744 ); 748 );
745} 749}