-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AUTO : Forward from derives_refactoring_7 to alpha (#1401)
fix nightly problems
- Loading branch information
1 parent
6378966
commit 879afb9
Showing
25 changed files
with
46 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,6 @@ | ||
//! In Rust, you often need to wrap a given type into a new one. | ||
//! The role of the orphan rules in particular is basically to prevent you from implementing external traits for external types. | ||
//! To overcome the restriction developer usually wrap the external type into a tuple introducing a new type. | ||
//! Type constructor does exactly that and auto-implement traits From, Into, Deref and few more for the constructed type. | ||
//! | ||
//! Macro [types](https://docs.rs/type_constructor/latest/type_constructor/types/macro.types.html) is responsible for generating code for Single, Pair, Homopair, Many. Each type constructor has its own keyword for that, but Pair and Homopair use the same keyword difference in a number of constituent types. It is possible to define all types at once. | ||
// qqq : xxx : write please | ||
|
||
#[ cfg( feature = "enabled" ) ] | ||
fn main() | ||
{ | ||
#[ cfg( feature = "type_constructor" ) ] | ||
{ | ||
use data_type::prelude::*; | ||
|
||
types! | ||
{ | ||
pub single MySingle : f32; | ||
pub single SingleWithParametrized : std::sync::Arc< T : Copy >; | ||
pub single SingleWithParameter : < T >; | ||
|
||
pub pair MyPair : f32; | ||
pub pair PairWithParametrized : std::sync::Arc< T1 : Copy >, std::sync::Arc< T2 : Copy >; | ||
pub pair PairWithParameter : < T1, T2 >; | ||
|
||
pub pair MyHomoPair : f32; | ||
pub pair HomoPairWithParametrized : std::sync::Arc< T : Copy >; | ||
pub pair HomoPairWithParameter : < T >; | ||
|
||
pub many MyMany : f32; | ||
pub many ManyWithParametrized : std::sync::Arc< T : Copy >; | ||
pub many ManyWithParameter : < T >; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.