-
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.
Merge pull request #5 from popzxc/support-doc-comments
Support doc comments
- Loading branch information
Showing
6 changed files
with
80 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "trait-set" | ||
version = "0.2.0" | ||
version = "0.3.0" | ||
authors = ["Igor Aleksanov <[email protected]>"] | ||
edition = "2018" | ||
repository = "https://github.com/popzxc/trait-set" | ||
|
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,20 @@ | ||
//! Tests that adding doc-comment doesn't break the build. | ||
use trait_set::trait_set; | ||
|
||
trait_set! { | ||
/// This is a doc-comment! | ||
/// | ||
/// It has multiple lines! | ||
/// | ||
#[doc = "And it's mixed with different flavors of comments..."] | ||
/** Even block-comments, */ | ||
pub(crate) trait TraitSet = Send + Sync; | ||
} | ||
|
||
fn test_set<T: TraitSet>(_arg: T) {} | ||
|
||
fn main() { | ||
test_set(10u8); | ||
test_set("hello"); | ||
} |
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,11 +1,23 @@ | ||
error[E0277]: `RefCell<u8>` cannot be shared between threads safely | ||
--> $DIR/01_bound_failure.rs:13:10 | ||
| | ||
10 | fn test<T: ThreadSafe>(_t: T) {} | ||
| ---------- required by this bound in `test` | ||
... | ||
13 | test(RefCell::new(10u8)); | ||
| ^^^^^^^^^^^^^^^^^^ `RefCell<u8>` cannot be shared between threads safely | ||
| ---- ^^^^^^^^^^^^^^^^^^ `RefCell<u8>` cannot be shared between threads safely | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
= help: the trait `Sync` is not implemented for `RefCell<u8>` | ||
= note: required because of the requirements on the impl of `ThreadSafe` for `RefCell<u8>` | ||
note: required because of the requirements on the impl of `ThreadSafe` for `RefCell<u8>` | ||
--> $DIR/01_bound_failure.rs:6:1 | ||
| | ||
6 | / trait_set! { | ||
7 | | pub trait ThreadSafe = Send + Sync; | ||
| | ^^^^^^^^^^ | ||
8 | | } | ||
| |_^ | ||
note: required by a bound in `test` | ||
--> $DIR/01_bound_failure.rs:10:12 | ||
| | ||
10 | fn test<T: ThreadSafe>(_t: T) {} | ||
| ^^^^^^^^^^ required by this bound in `test` | ||
= note: this error originates in the macro `trait_set` (in Nightly builds, run with -Z macro-backtrace for more info) |