You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function rejects zero-sized types at compile-time. (That's a minimal example, real code would check other properties of the type not expressed via a trait, e.g. its alignment, etc., for unsafe/FFI/serialization purposes.)
cargo check doesn't report post-monomorphization errors like this. This is tracked at several places like #99682. I believe there was a discussion about if we should guarantee that all post-monomorphization will result in an error for cargo check or not, but I can't find it anymore.
Closing as duplicate of #99682 -- and also as not-a-bug; this is currently intended behavior since checking these constants requires doing a monomorphization pass which would massively slow down cargo check.
This function rejects zero-sized types at compile-time. (That's a minimal example, real code would check other properties of the type not expressed via a trait, e.g. its alignment, etc., for unsafe/FFI/serialization purposes.)
With
cargo build
the code is rejected, as expected. However withcargo check
it passes compilation.I expected the compilation to fail with both
cargo check
andcargo build
.Tested in Rust 1.71.0.
The text was updated successfully, but these errors were encountered: