]> git.ipfire.org Git - thirdparty/gcc.git/commit
typecheck: Properly select methods when dealing with specialization
authorArthur Cohen <arthur.cohen@embecosm.com>
Thu, 3 Apr 2025 14:22:10 +0000 (16:22 +0200)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 14 Apr 2025 07:32:30 +0000 (07:32 +0000)
commitb9fdd60c28472f8163f7952bee2473e1d8e6981e
tree72849022a30aba6fa14dd101771da839807e0bb1
parent7ef77dad7cdd8d4b2b558a190b03a4e39557feab
typecheck: Properly select methods when dealing with specialization

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-expr.cc (is_default_fn): New.
(emit_ambiguous_resolution_error): New.
(handle_multiple_candidates): Properly handle multiple candidates in
the case of specialization.
(TypeCheckExpr::visit): Call `handle_multiple_candidates`.

gcc/testsuite/ChangeLog:

* rust/execute/torture/min_specialization2.rs: New test.
* rust/execute/torture/min_specialization3.rs: New test.
gcc/rust/typecheck/rust-hir-type-check-expr.cc
gcc/testsuite/rust/execute/torture/min_specialization2.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/min_specialization3.rs [new file with mode: 0644]