Repository navigation
Tracking issue for future-incompatbility lint order_dependent_trait_objects #56484
Description
Activity
- addedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lints
on Dec 3, 2018 (pending lang team decision in #56481 or somewhere else)
Triage: The
traitobjectcrate has still not been fixed (fix still pending in reem/rust-traitobject#6), but this has been a warning for over a year at this point.There is a ton of code that, down in its bowels, uses traitobject v0.1.0, and that crate is going to cause a lot of Rust-dependent projects to fail when this warning becomes a compile break. The maintainer seems to not be maintaining it any further. Is there someone on the Rust team that could take a look at it, and possibly fork it/fix it? Or any one of you Rust super-users? It is impossible to justify pushing something to production when we get a warning that something soon will break. As an example, ALL of the various derivatives of the Rust Book contain examples using Iron. But Iron depends on traitobject. I just spent a day working on a simple https server with iron, but due to the warning, I'm trashing the project and starting over with actix-web.
Reacted by Matthew Ahrens, Danny McClanahan, Michael Goulet, Kisaragi and Ryan AvellaNoting in light of the above comment that the breaking changes policy also linked in OP currently states:
What precisely constitutes "small" impact? This RFC does not attempt to define when the impact of a patch is "small" or "not small". We will have to develop guidelines over time based on precedent.
And it seems like this should probably be clarified so that the project can address the above comment.
There is a ton of code that, down in its bowels, uses traitobject v0.1.0, and that crate is going to cause a lot of Rust-dependent projects to fail when this warning becomes a compile break. The maintainer seems to not be maintaining it any further. Is there someone on the Rust team that could take a look at it, and possibly fork it/fix it? Or any one of you Rust super-users? It is impossible to justify pushing something to production when we get a warning that something soon will break. As an example, ALL of the various derivatives of the Rust Book contain examples using Iron. But Iron depends on traitobject. I just spent a day working on a simple https server with iron, but due to the warning, I'm trashing the project and starting over with actix-web.
I think it is not possible unless fix every "fix-able-dependency." It is known that fixing deep dependency will affect more crate.
- addedT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
on Apr 24, 2024 - changed the title
[-]`order_dependent_trait_impls` future compatibility lint[/-][+]`order_dependent_trait_objects` future compatibility lint[/+]on Apr 24, 2024 - changed the title
[-]`order_dependent_trait_objects` future compatibility lint[/-][+]Tracking issue for future-incompatbility lint `order_dependent_trait_objects`[/+]on Sep 14, 2024 - addedC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCA-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)Area: auto traits (e.g., `auto trait Send {}`)A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.and removedB-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.
on Sep 14, 2024 - addedA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.and removedA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
on Dec 21, 2024 - added a commit that references this issue
on Feb 13, 2025 - added a commit that references this issue
on Mar 9, 2025 - added a commit that references this issue
on Mar 9, 2025 - added a commit that references this issue
on Mar 9, 2025 - added a commit that references this issue
on Apr 29, 2026 - added a commit that references this issue
on Jul 14, 2026
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIdea
This is the summary issue for the
order_dependent_trait_implsfuture-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?
As in issue #33140, rustc sometimes treats "seemingly-identical" trait object types as different. For example,
Send + SyncandSync + Sendare treated as different types.This occurs because the first trait in a trait object is treated specially in the compiler, which means that
Send + Synchas its "first trait" beingSendandSync + Sendhas its "first trait" beingSync. That is a bug that we want to fix.However, because the compiler made this distinction, it was possible to implement a trait separately for each of these types, for example:
This obviously can't work if
Send + Sync&Sync + Sendare the same type! Therefore, it is being made into a coherence error.To fix the warnings, remove all but one of the impls - e.g. the
Sync + Sendimpl.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.
Status
deny-by default and report in deps in makeorder_dependent_trait_objectsshow up in future-breakage reports #102635