syntax highlight code examples in docstrings#6771
Merged
bors merged 1 commit intorust-lang:incomingfrom May 28, 2013
thestinger:highlight
Merged
syntax highlight code examples in docstrings#6771bors merged 1 commit intorust-lang:incomingfrom thestinger:highlight
bors merged 1 commit intorust-lang:incomingfrom
thestinger:highlight
Conversation
bors
added a commit
that referenced
this pull request
May 28, 2013
This works with pandoc linked against highlighting-kate >= 0.5.3.8. It seems to just be a no-op with earlier versions, because I successfully ran this through `try`. This also fixes some consistency issues (like making `Example`/`Examples` always a header and always using three tildes).
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Feb 25, 2021
Fix FP in inherent_to_string when the function has generic parameters
Minimal example of the false positive:
````
struct G;
impl G {
fn to_string<const _N: usize>(&self) -> String {
"G.to_string()".to_string()
}
}
fn main() {
let g = G;
g.to_string::<1>();
}
````
Clippy emits an `inherent_to_string` warning, and suggests that we implement `Display` for `G` instead. However, this is not possible, since the generic parameter _N only exists in this function, not in `G` itself. This particular example uses const generics, which is where the issue is most likely to come up, but this PR skips the lint if the `to_string` function has any kind of generic parameters.
changelog: Fix FP in `inherent_to_string`
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This works with pandoc linked against highlighting-kate >= 0.5.3.8. It seems to just be a no-op with earlier versions, because I successfully ran this through
try.This also fixes some consistency issues (like making
Example/Examplesalways a header and always using three tildes).