-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Atomic doc examples specific to each type #49029
Conversation
src/libcore/num/mod.rs
Outdated
@@ -96,6 +96,7 @@ pub mod dec2flt; | |||
pub mod bignum; | |||
pub mod diy_float; | |||
|
|||
#[macro_export] | |||
macro_rules! doc_comment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[00:04:50] error: This node does not have a stability attribute
[00:04:50] --> libcore/num/mod.rs:100:1
[00:04:50] |
[00:04:50] 100 | / macro_rules! doc_comment {
[00:04:50] 101 | | ($x:expr, $($tt:tt)*) => {
[00:04:50] 102 | | #[doc = $x]
[00:04:50] 103 | | $($tt)*
[00:04:50] 104 | | };
[00:04:50] 105 | | }
[00:04:50] | |_^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that by adding #[macro_export]
you've added this macro to libcore's public API. If you just want to use the macro internally, the necessary step is to add #[macro_use]
to its module instead.
If you actually want to make doc_comment!
a public macro, i'll want to bring in someone from libs team to remark on its viability.
6a5b68b
to
77f76f0
Compare
Looks like the doctests themselves are failing. Some overflowing literals, and attempts to negate unsigned integers.
|
77f76f0
to
9fc648a
Compare
Updated. |
a473ded
to
f9e81de
Compare
src/libcore/sync/atomic.rs
Outdated
# Examples | ||
|
||
``` | ||
#![feature(integer_atomics)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this feature gate appear on every atomic's docs? It may be misleading to have this on (for example) AtomicUsize
which doesn't require it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed!
f9e81de
to
2b64799
Compare
Updated. |
Looks good! @bors r+ |
📌 Commit 2b64799 has been approved by |
…Misdreavus Make Atomic doc examples specific to each type Fixes rust-lang#49018.
…Misdreavus Make Atomic doc examples specific to each type Fixes rust-lang#49018. r? @QuietMisdreavus
Fixes #49018.
r? @QuietMisdreavus