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

where_clauses_object_safety future compatibility lint warning #150

Closed
andrewpollack opened this issue Dec 28, 2022 · 4 comments
Closed

where_clauses_object_safety future compatibility lint warning #150

andrewpollack opened this issue Dec 28, 2022 · 4 comments
Labels
blocking-next-release This issue should be resolved before we release on crates.io

Comments

@andrewpollack
Copy link

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.

@andrewpollack
Copy link
Author

Also, see rust-lang/rust#102546 for issues on where_clauses_object_safety lint diagnostics

@joshlf joshlf added the blocking-next-release This issue should be resolved before we release on crates.io label Dec 31, 2022
@joshlf
Copy link
Member

joshlf commented Apr 27, 2023

rust-lang/rust#51443 (comment) says:

When will this warning become a hard error?

Hopefully we will develop a finer-grained rule and this warning will never be an error.

We should revisit this when we're actually ready to release 0.7.0 and see what progress has been made on developing a finer-grained rule.

@joshlf
Copy link
Member

joshlf commented Aug 12, 2023

@andrewpollack Are you still seeing this? I realized that, despite not having intentionally done anything about this, I've not seen this error emitted even in versions of the compiler after the one you linked.

@joshlf
Copy link
Member

joshlf commented Aug 20, 2023

I'm gonna close this for now. Feel free to re-open if you are still seeing this.

@joshlf joshlf closed this as completed Aug 20, 2023
@joshlf joshlf mentioned this issue Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking-next-release This issue should be resolved before we release on crates.io
Projects
None yet
Development

No branches or pull requests

2 participants