Skip to content

rustc::traits::orphan_check_trait_ref does not consider TraitDef::is_marker #67919

Closed
@Centril

Description

@Centril

It seems like #53693 did not update the orphan checker to consider #[marker] traits.

  • Suppose I have crates A, B, C.
  • A defines #[marker] trait Foo {}
  • B defines struct Bar;
  • C defines impl Foo for Bar {}

This should be OK because the overlap would actually be permitted as Foo is a #[marker] trait.

However, there might be something I've overlooked here such as impl polarity (impls_are_allowed_to_overlap) so I'm not filing a PR just now.

cc @nikomatsakis @arielb1 @scottmcm
cc #29864

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-bugCategory: This is a bug.F-marker_trait_attr`#![feature(marker_trait_attr)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions