Skip to content

api: Add a test for trait dyn compatibility #3829

@tcharding

Description

@tcharding

dyn compatibility (formerly object safety) can be verified by using

struct Foo {
    // If this compiles then `Trait` is dyn compatible.
    p: Box<dyn Trait>,
}

We should add such a test to any api test file (e.g. units/tests/api.rs).

Before closing this issue it must be done for all traits in all leaf crates

ref:

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.0Issues and PRs required or helping to stabilize the APIC-hashesPRs modifying the hashes crateC-primitivesC-unitsPRs modifying the units crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions