DUPLICATE_AUTO_TRAITS_IN_TRAIT_OBJECTS
future-compatibility warning
#56522
Labels
A-trait-system
Area: Trait system
C-future-incompatibility
Category: Future-incompatibility lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
This is the summary issue for the
DUPLICATE_AUTO_TRAITS_IN_TRAIT_OBJECTS
future-compatibility warning and other related errors. The goal of
this page is describe why this change was made and how you can fix
code that is affected by it. It also provides a place to ask questions
or register a complaint if you feel the change should not be made. For
more information on the policy around future-compatibility warnings,
see our breaking change policy guidelines.
What is the warning for?
Specifying the same auto trait more than once in the bounds for a trait object triggers this warning. For example,
dyn Send + Send
ordyn Debug + Sync + Sync
will both trigger this warning. Despite the warning, during the transitional period,dyn Send + Send
will be treated exactly the same asdyn Send
(bounds are said to be "deduplicated"), to maintain backwards compatibility.When will this warning become a hard error?
At the beginning of each 6-week release cycle, the Rust compiler team
will review the set of outstanding future compatibility warnings and
nominate some of them for Final Comment Period. Toward the end of
the cycle, we will review any comments and make a final determination
whether to convert the warning into a hard error or remove it
entirely.
The text was updated successfully, but these errors were encountered: