Skip to content
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

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

GuillaumeGomez
Copy link
Member

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 14, 2018
@kennytm kennytm added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Mar 15, 2018
@@ -96,6 +96,7 @@ pub mod dec2flt;
pub mod bignum;
pub mod diy_float;

#[macro_export]
macro_rules! doc_comment {
Copy link
Member

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]     | |_^

Copy link
Member

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.

@GuillaumeGomez GuillaumeGomez force-pushed the atomic-docs branch 2 times, most recently from 6a5b68b to 77f76f0 Compare March 15, 2018 23:13
@QuietMisdreavus
Copy link
Member

Looks like the doctests themselves are failing. Some overflowing literals, and attempts to negate unsigned integers.

[01:22:14] failures:
[01:22:14]     num/mod.rs - sync::atomic::AtomicI16::fetch_nand (line 110)
[01:22:14]     num/mod.rs - sync::atomic::AtomicI8::fetch_nand (line 110)
[01:22:14]     num/mod.rs - sync::atomic::AtomicU16::fetch_sub (line 107)
[01:22:14]     num/mod.rs - sync::atomic::AtomicU32::fetch_sub (line 107)
[01:22:14]     num/mod.rs - sync::atomic::AtomicU64::fetch_sub (line 107)
[01:22:14]     num/mod.rs - sync::atomic::AtomicU8::fetch_nand (line 110)
[01:22:14]     num/mod.rs - sync::atomic::AtomicU8::fetch_sub (line 107)
[01:22:14]     num/mod.rs - sync::atomic::AtomicUsize::fetch_sub (line 107)

@GuillaumeGomez
Copy link
Member Author

Updated.

@GuillaumeGomez GuillaumeGomez force-pushed the atomic-docs branch 2 times, most recently from a473ded to f9e81de Compare March 19, 2018 13:18
# Examples

```
#![feature(integer_atomics)]
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed!

@GuillaumeGomez
Copy link
Member Author

Updated.

@QuietMisdreavus
Copy link
Member

Looks good!

@bors r+

@bors
Copy link
Contributor

bors commented Mar 20, 2018

📌 Commit 2b64799 has been approved by QuietMisdreavus

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 20, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Mar 21, 2018
…Misdreavus

Make Atomic doc examples specific to each type

Fixes rust-lang#49018.
kennytm added a commit to kennytm/rust that referenced this pull request Mar 22, 2018
…Misdreavus

Make Atomic doc examples specific to each type

Fixes rust-lang#49018.

r? @QuietMisdreavus
bors added a commit that referenced this pull request Mar 22, 2018
@alexcrichton alexcrichton merged commit 2b64799 into rust-lang:master Mar 22, 2018
@GuillaumeGomez GuillaumeGomez deleted the atomic-docs branch March 23, 2018 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants