-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement associated function for all remaining derives and add tests
- Loading branch information
Showing
9 changed files
with
140 additions
and
24 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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use blanket::blanket; | ||
use impls::impls; | ||
|
||
use std::sync::Arc; | ||
|
||
#[blanket(derive(Arc))] | ||
pub trait StaticChecker { | ||
fn check(); | ||
} | ||
|
||
#[derive(Default)] | ||
struct NoOpChecker; | ||
|
||
impl StaticChecker for NoOpChecker { | ||
fn check() {} | ||
} | ||
|
||
fn main() { | ||
assert!(impls!( NoOpChecker: StaticChecker)); | ||
assert!(impls!(Arc<NoOpChecker>: StaticChecker)); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use blanket::blanket; | ||
use impls::impls; | ||
|
||
#[blanket(derive(Box))] | ||
pub trait StaticChecker { | ||
fn check(); | ||
} | ||
|
||
#[derive(Default)] | ||
struct NoOpChecker; | ||
|
||
impl StaticChecker for NoOpChecker { | ||
fn check() {} | ||
} | ||
|
||
fn main() { | ||
assert!(impls!( NoOpChecker: StaticChecker)); | ||
assert!(impls!(Box<NoOpChecker>: StaticChecker)); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use blanket::blanket; | ||
use impls::impls; | ||
|
||
#[blanket(derive(Mut))] | ||
pub trait StaticChecker { | ||
fn check(); | ||
} | ||
|
||
#[derive(Default)] | ||
struct NoOpChecker; | ||
|
||
impl StaticChecker for NoOpChecker { | ||
fn check() {} | ||
} | ||
|
||
fn main() { | ||
assert!(impls!( NoOpChecker: StaticChecker)); | ||
assert!(impls!(&mut NoOpChecker: StaticChecker)); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use blanket::blanket; | ||
use impls::impls; | ||
|
||
use std::rc::Rc; | ||
|
||
#[blanket(derive(Rc))] | ||
pub trait StaticChecker { | ||
fn check(); | ||
} | ||
|
||
#[derive(Default)] | ||
struct NoOpChecker; | ||
|
||
impl StaticChecker for NoOpChecker { | ||
fn check() {} | ||
} | ||
|
||
fn main() { | ||
assert!(impls!( NoOpChecker: StaticChecker)); | ||
assert!(impls!(Rc<NoOpChecker>: StaticChecker)); | ||
} |
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