-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Support specifying edition in doc test #54350
Support specifying edition in doc test #54350
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@QuietMisdreavus, @GuillaumeGomez: I've tried to add the banner as well, but I'm not sure how to test it, and I don't know if you want some additional styling on it. Right now it just shows up as a little black (!) icon that says "This code runs with edition 2018/2015". |
This comment has been minimized.
This comment has been minimized.
1381281
to
d4f09a2
Compare
This comment has been minimized.
This comment has been minimized.
d4f09a2
to
b87338d
Compare
This comment has been minimized.
This comment has been minimized.
b87338d
to
bd08d11
Compare
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.
Could you update the Rustdoc book (in src/doc/rustdoc
) to mention this as well?
@steveklabnik is d9e16d6 alright, or would you like more information? |
@@ -323,6 +323,20 @@ compiles, then the test will fail. However please note that code failing | |||
with the current Rust release may work in a future release, as new features | |||
are added. | |||
|
|||
```text | |||
/// Only runs on the 2018 edition. | |||
/// ```edition2018 |
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.
Please add an empty doc comment line before this one.
/// }; | ||
/// assert!(result.is_err()); | ||
/// ``` | ||
|
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.
I'm not sure tests will be called here. Can you add pub fn foo() {}
in here please? (or replace fn main
with 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.
I've updated the PR
d9e16d6
to
81695df
Compare
81695df
to
06b1975
Compare
Ok, looks good to me. Waiting for @steveklabnik now. |
Thank you so much! This is a very important feature. @bors: r+ rollup |
📌 Commit 06b1975 has been approved by |
@bors: rollup- (actually this should get tested on its own. habits die hard!) |
Thank you! It's always a pleasure to work with the rust team. |
…est, r=steveklabnik Support specifying edition in doc test Fixes rust-lang#52623 r? @QuietMisdreavus
Rollup of 16 pull requests Successful merges: - #53652 (define copy_within on slices) - #54261 (Make `dyn` a keyword in the 2018 edition) - #54280 (remove (more) CAS API from Atomic* types where not natively supported) - #54323 (rustbuild: drop color handling) - #54350 (Support specifying edition in doc test) - #54370 (Improve handling of type bounds in `bit_set.rs`.) - #54371 (add -Zui-testing to rustdoc) - #54374 (Make 'proc_macro::MultiSpan' public.) - #54402 (Use no_default_libraries for all NetBSD flavors) - #54409 (Detect `for _ in in bar {}` typo) - #54412 (add applicability to span_suggestion call) - #54413 (Add UI test for deref recursion limit printing twice) - #54415 (parser: Tweak function parameter parsing to avoid rollback on succesfull path) - #54420 (Compress `Liveness` data some more.) - #54422 (Simplify slice's first(_mut) and last(_mut) with get) - #54446 (Unify christianpoveda's emails) Failed merges: - #54058 (Introduce the partition_dedup/by/by_key methods for slices) r? @ghost
Rollup of 16 pull requests Successful merges: - #53652 (define copy_within on slices) - #54261 (Make `dyn` a keyword in the 2018 edition) - #54280 (remove (more) CAS API from Atomic* types where not natively supported) - #54323 (rustbuild: drop color handling) - #54350 (Support specifying edition in doc test) - #54370 (Improve handling of type bounds in `bit_set.rs`.) - #54371 (add -Zui-testing to rustdoc) - #54374 (Make 'proc_macro::MultiSpan' public.) - #54402 (Use no_default_libraries for all NetBSD flavors) - #54409 (Detect `for _ in in bar {}` typo) - #54412 (add applicability to span_suggestion call) - #54413 (Add UI test for deref recursion limit printing twice) - #54415 (parser: Tweak function parameter parsing to avoid rollback on succesfull path) - #54420 (Compress `Liveness` data some more.) - #54422 (Simplify slice's first(_mut) and last(_mut) with get) - #54446 (Unify christianpoveda's emails) Failed merges: - #54058 (Introduce the partition_dedup/by/by_key methods for slices) r? @ghost
Fixes #52623
r? @QuietMisdreavus