Skip to content

where_clauses_object_safety future compatibility lint warning #150

@andrewpollack

Description

@andrewpollack

Using the latest zerocopy-0.7.0-alpha.2 release on rustc ToT (83a28ef095ba4179a63196f16eadd97f110d6cb3) is leading to the following warning around future compatibility:

error: the trait `AsBytes` cannot be made into an object
 --> zerocopy-0.7.0-alpha.2/src/lib.rs:608:8
  |
  = 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: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
 --> zerocopy-0.7.0-alpha.2/src/lib.rs:608:8
  |
  = note: the trait cannot be made into an object because method `as_bytes_mut` references the `Self` type in its `where` clause

See rust-lang/rust#51443 for more context on this future compatibility lint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocking-next-releaseThis issue should be resolved before we release on crates.io

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions