Clarify that this only triggers when both traits are in scope

This commit is contained in:
Amanieu d'Antras 2024-05-06 11:09:27 +02:00
parent b32c37ef87
commit de6a4cfdc8
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,7 @@
# Summary
[summary]: #summary
When name resolution encounters an ambiguity between 2 trait methods, if one trait is a sub-trait of the other then select that method instead of reporting an ambiguity error.
When name resolution encounters an ambiguity between 2 trait methods when both traits are in scope, if one trait is a sub-trait of the other then select that method instead of reporting an ambiguity error.
# Motivation
[motivation]: #motivation
@ -47,6 +47,8 @@ This RFC proposes to change name resolution to resolve the ambiguity in the foll
When this happens, the sub-trait method is selected instead of reporting an ambiguity error.
Note that this only happens when *both* traits are in scope since this is required for the ambiguity to occur in the first place.
# Drawbacks
[drawbacks]: #drawbacks