-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Add rustX check to codeblock attributes lint #118872
Conversation
Thanks for the suggestion @Urgau! |
ef1536e
to
41e16a0
Compare
This comment has been minimized.
This comment has been minimized.
41e16a0
to
bb0fd66
Compare
Fixed the error. |
| | ||
= help: there is an attribute with a similar name: `edition2018` | ||
|
||
error: aborting due to 13 previous errors | ||
|
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.
What happens if you write two bad attributes in a row?
```rust2018 shouldpanic
panic!();
```
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.
This:
warning: unknown attribute `rust2018`
--> foo.rs:3:1
|
3 | / /**
4 | | ```rust2018 shouldpanic
5 | | panic!();
6 | | ```
7 | | */
| |__^
|
= help: there is an attribute with a similar name: `edition2018`
= note: `#[warn(rustdoc::invalid_codeblock_attributes)]` on by default
warning: unknown attribute `shouldpanic`
--> foo.rs:3:1
|
3 | / /**
4 | | ```rust2018 shouldpanic
5 | | panic!();
6 | | ```
7 | | */
| |__^
|
= help: there is an attribute with a similar name: `should_panic`
= help: the code block will either not be tested if not marked as a rust one or won't fail if it doesn't panic when running
warning: 2 warnings emitted
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.
Other than the above comment about combining multiple mistakes, this seems like a great diagnostic improvement. Thanks!
Add a test case for combining them, then r=me
@bors r=notriddle rollup |
…, r=notriddle Add rustX check to codeblock attributes lint We discovered this issue [here](rust-lang#118802 (comment)). I assume that the issue will be present in other places outside of the compiler so it's worth adding a check for it. First commit is just a small cleanup about variables creation which was a bit strange (at least more than necessary). r? `@notriddle`
…, r=notriddle Add rustX check to codeblock attributes lint We discovered this issue [here](rust-lang#118802 (comment)). I assume that the issue will be present in other places outside of the compiler so it's worth adding a check for it. First commit is just a small cleanup about variables creation which was a bit strange (at least more than necessary). r? ``@notriddle``
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#117050 ([`RFC 3086`] Attempt to try to resolve blocking concerns ) - rust-lang#118500 (Move some methods from `tcx.hir()` to `tcx`) - rust-lang#118871 (Coroutine variant fields can be uninitialized) - rust-lang#118872 (Add rustX check to codeblock attributes lint) - rust-lang#118884 (NFC: simplify merging of two vecs) - rust-lang#118885 (clippy::complexity fixes) - rust-lang#118886 (Clean up variables in `search.js`) - rust-lang#118887 (Typo) r? `@ghost` `@rustbot` modify labels: rollup
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#118858 (Remove dead codes in core) - rust-lang#118864 (Fix alignment passed down to LLVM for simd_masked_load) - rust-lang#118872 (Add rustX check to codeblock attributes lint) - rust-lang#118873 (fix `waker_getters` tracking issue number) - rust-lang#118884 (NFC: simplify merging of two vecs) - rust-lang#118885 (clippy::complexity fixes) - rust-lang#118886 (Clean up variables in `search.js`) - rust-lang#118887 (Typo) - rust-lang#118889 (more clippy::complexity fixes) - rust-lang#118891 (Actually parse async gen blocks correctly) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#118872 - GuillaumeGomez:codeblock-attr-lint, r=notriddle Add rustX check to codeblock attributes lint We discovered this issue [here](rust-lang#118802 (comment)). I assume that the issue will be present in other places outside of the compiler so it's worth adding a check for it. First commit is just a small cleanup about variables creation which was a bit strange (at least more than necessary). r? ```@notriddle```
We discovered this issue here.
I assume that the issue will be present in other places outside of the compiler so it's worth adding a check for it.
First commit is just a small cleanup about variables creation which was a bit strange (at least more than necessary).
r? @notriddle