diff --git a/test_crates/nonbreaking_item_rename/new/Cargo.toml b/test_crates/nonbreaking_item_rename/new/Cargo.toml new file mode 100644 index 00000000..3a4887ad --- /dev/null +++ b/test_crates/nonbreaking_item_rename/new/Cargo.toml @@ -0,0 +1,7 @@ +[package] +publish = false +name = "nonbreaking_item_rename" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/test_crates/nonbreaking_item_rename/new/src/lib.rs b/test_crates/nonbreaking_item_rename/new/src/lib.rs new file mode 100644 index 00000000..50fea028 --- /dev/null +++ b/test_crates/nonbreaking_item_rename/new/src/lib.rs @@ -0,0 +1,20 @@ +mod internal { + pub struct NewName; + + pub enum NewEnum { + Foo, + } + + pub trait NewTrait {} + + pub fn new_fn() {} +} + +pub use internal::{NewName, NewEnum, NewTrait, new_fn}; + +// Re-export the items under their old names, +// so that this isn't a breaking change. +pub use NewName as OldName; +pub use NewEnum as OldEnum; +pub use NewTrait as OldTrait; +pub use new_fn as old_fn; diff --git a/test_crates/nonbreaking_item_rename/old/Cargo.toml b/test_crates/nonbreaking_item_rename/old/Cargo.toml new file mode 100644 index 00000000..3a4887ad --- /dev/null +++ b/test_crates/nonbreaking_item_rename/old/Cargo.toml @@ -0,0 +1,7 @@ +[package] +publish = false +name = "nonbreaking_item_rename" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/test_crates/nonbreaking_item_rename/old/src/lib.rs b/test_crates/nonbreaking_item_rename/old/src/lib.rs new file mode 100644 index 00000000..3335f18c --- /dev/null +++ b/test_crates/nonbreaking_item_rename/old/src/lib.rs @@ -0,0 +1,13 @@ +mod internal { + pub struct OldName; + + pub enum OldEnum { + Foo, + } + + pub trait OldTrait {} + + pub fn old_fn() {} +} + +pub use internal::{OldName, OldEnum, OldTrait, old_fn};