Skip to content

Commit fd2ef7d

Browse files
committed
Remove the From derive macro from prelude
To avoid backwards compatibility problems.
1 parent 85cbfac commit fd2ef7d

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

core/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ pub mod assert_matches {
226226
pub use crate::macros::{assert_matches, debug_assert_matches};
227227
}
228228

229+
#[unstable(feature = "derive_from", issue = "144889")]
230+
/// Unstable module containing the unstable `From` derive macro.
231+
pub mod from {
232+
#[unstable(feature = "derive_from", issue = "144889")]
233+
pub use crate::macros::builtin::From;
234+
}
235+
229236
// We don't export this through #[macro_export] for now, to avoid breakage.
230237
#[unstable(feature = "autodiff", issue = "124509")]
231238
/// Unstable module containing the unstable `autodiff` macro.

core/src/prelude/v1.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,3 @@ pub use crate::macros::builtin::deref;
117117
reason = "`type_alias_impl_trait` has open design concerns"
118118
)]
119119
pub use crate::macros::builtin::define_opaque;
120-
121-
#[unstable(
122-
feature = "derive_from",
123-
issue = "144889",
124-
reason = "`derive(From)` is unstable"
125-
)]
126-
pub use crate::macros::builtin::From;

std/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,14 @@ pub use core::{
737737
unreachable, write, writeln,
738738
};
739739

740+
// Re-export unstable derive macro defined through core.
741+
#[unstable(feature = "derive_from", issue = "144889")]
742+
/// Unstable module containing the unstable `From` derive macro.
743+
pub mod from {
744+
#[unstable(feature = "derive_from", issue = "144889")]
745+
pub use core::from::From;
746+
}
747+
740748
// Include a number of private modules that exist solely to provide
741749
// the rustdoc documentation for primitive types. Using `include!`
742750
// because rustdoc only looks for these modules at the crate level.

0 commit comments

Comments
 (0)