Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make old names errors instead of warnings
Previously, we re-exported renamed traits as their old names via `pub use`. Despite including `#[deprecated]` attributes on each `pub use`, it still caused problems for us as described in #960. In this commit, we replace `pub use` with just `use`. This has the effect of making it so that using the old names is an error rather than a warning, which accomplishes two things: first, it ensures that the issue described in #960 can't happen, as the compiler will never generate suggestions to write code which generates errors. Second, it ensures that callers are forced to update to the new names, which makes it less likely for us to cause breakage when we eventually remove the `use` path. Note that, despite no longer having an explicit deprecation warning that explains what's happening, the error message still provides plenty of breadcrumb as to what happened. Consider this example error message: error[E0603]: trait `FromZeroes` is private --> examples/deprecated.rs:1:15 | 1 | use zerocopy::FromZeroes; | ^^^^^^^^^^ private trait | note: the trait `FromZeroes` is defined here --> /Users/josh/workspace/zerocopy/src/lib.rs:1845:5 | 1845 | use FromZeros as FromZeroes; The fact that the original source code is included makes it easy to see what's gone wrong - there's another item called `FromZeros` that can be used instead.
- Loading branch information