File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1768,4 +1768,15 @@ pub(crate) mod builtin {
1768
1768
pub macro deref( $pat: pat) {
1769
1769
builtin # deref( $pat)
1770
1770
}
1771
+
1772
+ /// Derive macro generating an impl of the trait `From`.
1773
+ /// Currently, it can only be used on single-field structs.
1774
+ // Note that the macro is in a different module than the `From` trait,
1775
+ // to avoid triggering an unstable feature being used if someone imports
1776
+ // `std::convert::From`.
1777
+ #[ rustc_builtin_macro]
1778
+ #[ unstable ( feature = "derive_from" , issue = "144889" ) ]
1779
+ pub macro From ( $item: item) {
1780
+ /* compiler built-in */
1781
+ }
1771
1782
}
Original file line number Diff line number Diff line change @@ -117,3 +117,10 @@ pub use crate::macros::builtin::deref;
117
117
reason = "`type_alias_impl_trait` has open design concerns"
118
118
) ]
119
119
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 ;
You can’t perform that action at this time.
0 commit comments