-
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
enable rust_2018_idioms
lint group for doctests
#106621
enable rust_2018_idioms
lint group for doctests
#106621
Conversation
r? @m-ou-se (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
c25110c
to
91178d2
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
@ozkanonur you should fix the warnings - if it's a lot of effort, we can split it up by crate on the original issue and ask for volunteers to help fix the issues. |
4580785
to
910829f
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.
The compiler changes look good to me, but we should probably have someone from libs sign off on the changes to the public docs.
r? libs @cuviper Do the changes to the standard library documentation look like an improvement? |
/// fn test<'a, T: Debug>(x: &'a T) -> impl Debug + 'a { | ||
/// x | ||
/// } | ||
/// ``` | ||
/// | ||
/// we will create a TAIT definition in the HIR like | ||
/// | ||
/// ``` | ||
/// ```rust,ignore (pseudo-Rust) |
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.
If it was compiling before, why not add a hidden import instead?
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.
why not add a hidden import instead?
There are multiple errors, and one of them was:
error: unconstrained opaque type
--> src/lib.rs:1488:30
|
4 | type TestReturn<'a, 'x, T> = impl Debug + 'x;
| ^^^^^^^^^^^^^^^
|
= note: `TestReturn` must be used in combination with a concrete type within the same item
/// type TestReturn<'a, T, 'x> = impl Debug + 'x | ||
/// ``` | ||
/// | ||
/// and return a type like `TestReturn<'static, T, 'a>`, so that the function looks like: | ||
/// | ||
/// ```rust | ||
/// ```rust,ignore (pseudo-Rust) |
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.
If it was compiling before, why not add a hidden import instead?
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.
It's using dummy type defined on the previous doc-comment which is also ignored.
@@ -1038,7 +1038,7 @@ impl<'a> MethodDef<'a> { | |||
/// `&self.x` because that might cause an unaligned ref. So for any trait | |||
/// method that takes a reference, we use a local block to force a copy. | |||
/// This requires that the field impl `Copy`. | |||
/// ``` | |||
/// ```rust,ignore (example) |
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.
Why ignoring this one?
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.
Signed-off-by: ozkanonur <work@onurozkan.dev>
9e811dd
to
4e7c14f
Compare
@rustbot ready |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ea0c22e): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: missing data |
Update doc for `PhantomData` to match code example After rust-lang#106621, there is no longer a `T: 'a` annotation in the doc example, so update the text to match the code.
Update doc for `PhantomData` to match code example After rust-lang#106621, there is no longer a `T: 'a` annotation in the doc example, so update the text to match the code.
Update doc for `PhantomData` to match code example After rust-lang/rust#106621, there is no longer a `T: 'a` annotation in the doc example, so update the text to match the code.
With this change,
rust_2018_idioms
lint group will be enabled for compiler/libstd doctests.Resolves #106086
Resolves #99144
Signed-off-by: ozkanonur work@onurozkan.dev