Description
This is the summary issue for the CENUM_IMPL_DROP_CAST
future-incompatibility lint and other related errors. The goal of this page is describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or register a complaint if you feel the change should not be made. For more information on the policy around future-compatibility warnings, see our breaking change policy guidelines.
What is the warning for?
The warning is issue when a C-like enum implementing the Drop
trait is cast. For example:
enum E {
A = 0,
}
impl Drop for E {
fn drop(&mut self) {
println!("Drop");
}
}
fn main() {
let e = E::A;
let i = e as u32;
^^^^^^^^ here is the cast
}
This cast will be rejected to enforce uniformity between all moving operations. See #35941 for more details.
When will this warning become a hard error?
At the beginning of each 6-week release cycle, the Rust compiler team will review the set of outstanding future compatibility warnings and nominate some of them for Final Comment Period. Toward the end of the cycle, we will review any comments and make a final determination whether to convert the warning into a hard error or remove it entirely.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status