Skip to content

Commit

Permalink
AUTO : Forward from derives_refactoring_7 to alpha (#1401)
Browse files Browse the repository at this point in the history
fix nightly problems
  • Loading branch information
wtools-bot authored Jul 3, 2024
1 parent 6378966 commit 879afb9
Show file tree
Hide file tree
Showing 25 changed files with 46 additions and 237 deletions.
2 changes: 1 addition & 1 deletion module/core/clone_dyn_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub mod dependency
}

/// Internal namespace.
#[ cfg( any( not( feature = "no_std" ), feature = "use_alloc" ) ) ]
// #[ cfg( any( not( feature = "no_std" ), feature = "use_alloc" ) ) ]
#[ cfg( feature = "enabled" ) ]
pub( crate ) mod private
{
Expand Down
6 changes: 3 additions & 3 deletions module/core/data_type/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ default = [
"dt_either",
"dt_prelude",
"dt_interval",
"dt_collections",
"dt_collection",
# "dt_make",
# "dt_vectorized_from",
# "type_constructor/default",
Expand All @@ -45,7 +45,7 @@ full = [
"dt_either",
"dt_prelude",
"dt_interval",
"dt_collections",
"dt_collection",
# "dt_make",
# "dt_vectorized_from",
# "type_constructor/full",
Expand All @@ -57,7 +57,7 @@ enabled = []
# dt_prelude = [ "collection_tools/reexports" ]
dt_prelude = [] # rid of maybe?
dt_interval = [ "interval_adapter/enabled" ]
dt_collections = [ "collection_tools/enabled" ]
dt_collection = [ "collection_tools/enabled" ]
dt_either = [ "either" ]

# qqq : for Anton : integrate all features of collection_tools into data_type and reuse tests
Expand Down
20 changes: 2 additions & 18 deletions module/core/data_type/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,12 @@ Macro [types](https://docs.rs/type_constructor/latest/type_constructor/types/mac
<!-- {{# generate.module{} #}} -->

```rust
#[ cfg( feature = "type_constructor" ) ]
#[ cfg( feature = "enabled" ) ]
{
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 >;
// qqq : xxx : write please

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 >;
}
}
```

Expand Down
32 changes: 3 additions & 29 deletions module/core/data_type/examples/data_type_trivial.rs
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 >;
}
}
}
2 changes: 1 addition & 1 deletion module/core/data_type/tests/inc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ mod either_test;
// #[ path = "../../../../core/type_constructor/tests/inc/mod.rs" ]
// mod type_constructor;

#[ cfg( any( feature = "interval", feature = "dt_interval" ) ) ]
#[ cfg( any( feature = "dt_interval" ) ) ]
#[ path = "../../../../core/interval_adapter/tests/inc/mod.rs" ]
mod interval_test;
6 changes: 1 addition & 5 deletions module/core/data_type/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
// #![ deny( rust_2018_idioms ) ]
// #![ deny( missing_debug_implementations ) ]
// #![ deny( missing_docs ) ]

// #![ feature( trace_macros ) ]
#![ cfg_attr( feature = "no_std", no_std ) ]

#[ allow( unused_imports ) ]
use data_type as the_module;
Expand Down
8 changes: 5 additions & 3 deletions module/core/derive_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ default = [
"derive_is_variant",
"derive_unwrap",
# "derive_convert_case",
"derive_into",

"derive_display",
"derive_from_str",
Expand Down Expand Up @@ -155,6 +156,7 @@ derive_index_mut = [ "derive_more", "derive_more/std", "derive_more/index_mut" ]
# derive_inner_from = [ "derive_more", "derive_more/into" ]
derive_into_iterator = [ "derive_more", "derive_more/std", "derive_more/into_iterator" ]
# derive_iterator = [ "derive_more", "derive_more/iterator" ]
derive_into = [ "derive_more", "derive_more/into" ]
derive_mul_assign = [ "derive_more", "derive_more/std", "derive_more/mul_assign" ]
derive_mul = [ "derive_more", "derive_more/std", "derive_more/mul" ]
derive_not = [ "derive_more", "derive_more/std", "derive_more/not" ]
Expand Down Expand Up @@ -196,9 +198,9 @@ parse-display = { version = "~0.8.2", optional = true, default-features = false


## internal
derive_tools_meta = { workspace = true, features = [] }
variadic_from = { workspace = true, features = [] }
clone_dyn = { workspace = true, features = [ "clone_dyn_types", "clone_dyn_meta" ] }
derive_tools_meta = { workspace = true, optional = true, features = [] }
variadic_from = { workspace = true, optional = true, features = [] }
clone_dyn = { workspace = true, optional = true, features = [ "clone_dyn_types", "clone_dyn_meta" ] }


[dev-dependencies]
Expand Down
123 changes: 3 additions & 120 deletions module/core/derive_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ mod derive_more
pub use ::derive_more::Index;
#[ cfg( feature = "derive_into" ) ]
pub use ::derive_more::Into;
#[ cfg( feature = "derive_iterator" ) ]
pub use ::derive_more::Iterator;
// #[ cfg( feature = "derive_iterator" ) ]
// pub use ::derive_more::Iterator;
#[ cfg( feature = "derive_into_iterator" ) ]
pub use ::derive_more::IntoIterator;
#[ cfg( feature = "derive_mul" ) ]
Expand All @@ -76,12 +76,6 @@ mod derive_more
#[ cfg( any( feature = "derive_variadic_from", feature = "type_variadic_from" ) ) ]
pub use variadic_from as variadic;

// #[ cfg( feature = "derive_reflect" ) ]
// pub mod reflect;

// use derive_tools_meta::Deref;
// use derive_tools_meta::VariadicFrom;

/// Namespace with dependencies.
#[ allow( unused_imports ) ]
Expand All @@ -90,11 +84,10 @@ pub mod dependency
{

#[ doc( inline ) ]
#[ cfg( any_derive ) ]
pub use ::derive_tools_meta;

#[ doc( inline ) ]
#[ cfg( feature = "clone_dyn" ) ]
#[ cfg( feature = "derive_clone_dyn" ) ]
pub use ::clone_dyn::{ self, dependency::* };

#[ doc( inline ) ]
Expand Down Expand Up @@ -128,15 +121,7 @@ pub mod own
pub use orphan::*;
#[ cfg( feature = "derive_clone_dyn" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::clone_dyn::orphan::*;
// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use super::wtools::orphan::*;
// #[ cfg( feature = "derive_reflect" ) ]
// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use super::reflect::orphan::*;
}

/// Orphan namespace of the module.
Expand All @@ -160,127 +145,44 @@ pub mod exposed

#[ cfg( all( feature = "derive_more" ) ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use super::derive_more::*;

#[ cfg( feature = "derive_strum" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::strum::*;

#[ cfg( any( feature = "derive_variadic_from", feature = "type_variadic_from" ) ) ]
#[ doc( inline ) ]
pub use ::variadic_from::exposed::*;

// #[ cfg( all( feature = "derive_more", feature = "derive_add" ) ) ]
// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use ::derive_more::Add;

// #[ allow( ambiguous_glob_reexports ) ]
// #[ cfg( feature = "derive_more" ) ]
// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use ::derive_more::
// {
// Add,
// AddAssign,
// AsMut,
// AsRef,
// Binary,
// BitAnd,
// BitAndAssign,
// BitOr,
// BitOrAssign,
// BitXor,
// BitXorAssign,
// Constructor,
// Debug,
// Deref,
// DerefMut,
// Display,
// Div,
// DivAssign,
// Error,
// From,
// FromStr,
// Index,
// IndexMut,
// Into,
// IntoIterator,
// IsVariant,
// LowerExp,
// LowerHex,
// Mul,
// MulAssign,
// Neg,
// Not,
// Octal,
// Pointer,
// Product,
// Rem,
// RemAssign,
// Shl,
// ShlAssign,
// Shr,
// ShrAssign,
// Sub,
// SubAssign,
// Sum,
// TryFrom,
// TryInto,
// TryUnwrap,
// Unwrap,
// UpperExp,
// UpperHex,
// };

#[ cfg( feature = "derive_strum" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::strum::*;

#[ cfg( feature = "derive_display" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::parse_display::Display;

#[ cfg( feature = "derive_from_str" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::parse_display::FromStr;

#[ cfg( feature = "derive_clone_dyn" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::clone_dyn::exposed::*;

#[ cfg( feature = "derive_clone_dyn" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::clone_dyn;

// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use super::wtools::exposed::*;

// #[ cfg( feature = "derive_reflect" ) ]
// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use super::reflect::exposed::*;

// #[ cfg( any_derive ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::derive_tools_meta::*;

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
#[ cfg( feature = "derive_from" ) ]
pub use ::derive_tools_meta::From;

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
#[ cfg( feature = "derive_inner_from" ) ]
pub use ::derive_tools_meta::InnerFrom;

Expand All @@ -294,33 +196,14 @@ pub mod prelude
use super::*;
#[ cfg( feature = "derive_clone_dyn" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::clone_dyn;

#[ cfg( feature = "derive_clone_dyn" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::clone_dyn::prelude::*;

// it should already be in predlue of clone_dyn
// #[ cfg( feature = "derive_clone_dyn" ) ]
// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use ::clone_dyn::clone_dyn;

#[ cfg( any( feature = "derive_variadic_from", feature = "type_variadic_from" ) ) ]
#[ doc( inline ) ]
pub use ::variadic_from::prelude::*;

// #[ cfg( feature = "derive_reflect" ) ]
// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use super::reflect::prelude::*;

// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use super::wtools::prelude::*;
// #[ doc( no_inline ) ]
// pub use super::wtools;

}
2 changes: 0 additions & 2 deletions module/core/derive_tools_meta/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ pub mod inner_from;
pub mod new;
#[ cfg( feature = "derive_variadic_from" ) ]
pub mod variadic_from;
#[ cfg( feature = "derive_reflect" ) ]
pub mod reflect;
#[ cfg( feature = "derive_phantom" ) ]
pub mod phantom;
1 change: 1 addition & 0 deletions module/core/derive_tools_meta/src/derive/inner_from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ fn from_impl_multiple_fields< 'a >
///
/// ## Output
/// ```rust
/// use std::convert::From;
/// pub struct Struct;
/// #[ allow( non_local_definitions ) ]
/// #[ allow( clippy::unused_imports ) ]
Expand Down
5 changes: 0 additions & 5 deletions module/core/inspect_type/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@ workspace = true
features = [ "full" ]
all-features = false



[features]
default = [ "enabled" ]
full = [ "enabled" ]
no_std = []
use_alloc = [ "no_std" ]
enabled = []
# nightly = []

[dependencies]

Expand Down
Loading

0 comments on commit 879afb9

Please sign in to comment.