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

Deny all warnings by default in doc tests #8067

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

Allow some common ones that are good for examples, however.

Closes #3636

Allow some common ones that are good for examples, however.
bors added a commit that referenced this pull request Jul 27, 2013
Allow some common ones that are good for examples, however.

Closes #3636
@bors bors closed this Jul 27, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 6, 2021
…le_char_pattern, r=giraffate

Escape backslash in single_char_pattern.rs

Escape backslash in single_char_pattern.

Previously, the proposed clippy fix for a single backslash in raw strings ```r"\"``` or ```r#"\"#``` was also only an unescaped, *single* ```'\'```:
```shell
warning: single-character string constant used as pattern
2 |     let s = r#"abc\xyz/"#.find(r"\");
  |                                ^^^^ help: try using a `char` instead: `'\'`
  |
  = note: `#[warn(clippy::single_char_pattern)]` on by default
```

This PR corrects this to a properly escaped *double* backslash ```'\\'```.
I haven't come up with any other problematic cases, a single quote was already handled.

Closes: rust-lang#8060

changelog:  Escape backslash in ``[`single_char_pattern`]``
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.

doc tests should run with warnings as errors
3 participants