Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not dereference uninhabited types refs in Clone implementations #3456

Merged
merged 1 commit into from Nov 30, 2023

Commits on Nov 28, 2023

  1. Do not dereference uninhabited types refs in Clone implementations

    A reference to an uninhabited type should never be dereferenced:
    this is UB. `Copy` should not be implemented on such a type, and
    an upcoming Clippy lint (`uninhabited_reference`) may flag such
    dereferences as suspicious.
    
    Since those types are not structs, they do not need to get `Copy`
    and `Clone` implementations. A `missing!` macro limits code
    duplication.
    samueltardieu committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    a693257 View commit details
    Browse the repository at this point in the history