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

syntax highlight code examples in docstrings #6771

Merged
merged 1 commit into from
May 28, 2013
Merged

syntax highlight code examples in docstrings #6771

merged 1 commit into from
May 28, 2013

Conversation

thestinger
Copy link
Contributor

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).

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).
@bors bors closed this May 28, 2013
@bors bors merged commit 0d5fdce into rust-lang:incoming May 28, 2013
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants