Skip to content

warning: the trait Any cannot be made into an object #23

Open
@alecmocatta

Description

@alecmocatta

This warning is spurious, as noted in the linked issue rust-lang/rust#51443 the lint is overly broad and in fact needn't fire for marker traits.

This could be fixed in rustc by adjusting the lint here: https://github.com/rust-lang/rust/blob/2f16be42dd64669b784559e98662d9712ce13fab/src/librustc/traits/object_safety.rs#L343

See also the commit that introdued the lint: rust-lang/rust@1453b3a

warning: the trait `serde_traitobject::convenience::Any` cannot be made into an object
  |
  = note: `#[warn(where_clauses_object_safety)]` on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #51443 <https://github.com/rust-lang/rust/issues/51443>
  = note: method `into_any_send` references the `Self` type in where clauses

rustc PR to fix this: rust-lang/rust#66122

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions