Skip to content

Define coherence restrictions in the manual impl section. #9743

Closed
@nejucomo

Description

@nejucomo

I'm familiar with coherence restrictions on trait impls only from IRC conversations ages ago. It came up in IRC again, and I briefly skimmed the manual sections on impls and crates to see if this restriction was spelled out.

I may have missed it. Even in that case, I feel it would be most useful in the manual section describing impls: 6.1.9 Implementations (v0.8 manual)

pcwalton has a good blog post providing background: Coherence, Modularity, and Extensibility for Typeclasses

There was some confusion on IRC as to whether coherence restrictions are per-module or per-crate.

Some questions I'd like to see answered in the manual:

  • Are trait impls "always public" even when buried in non-public modules?
  • Can a crate define a trait in one module, A, and an impl in another module B coherently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions