Commit 1e6df58
authored
Rollup merge of rust-lang#140794 - karolzwolak:allow-unused-doc-65464, r=davidtwco
mention lint group in default level lint note
### Summary
This PR updates lint diagnostics so that default-level notes now mention the lint group they belong to, if any.
Fixes: rust-lang#65464.
### Example
```rust
fn main() {
let x = 5;
}
```
Before:
```
= note: `#[warn(unused_variables)]` on by default
```
After:
```
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
```
### Unchanged Cases
Messages remain the same when the lint level is explicitly set, e.g.:
* Attribute on the lint `#[warn(unused_variables)]`:
```
note: the lint level is defined here
LL | #[warn(unused_variables)]
| ^^^^^^^^^^^^^^^^
```
* Attribute on the group `#[warn(unused)]:`:
```
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
```
* CLI option `-W unused`:
```
= note: `-W unused-variables` implied by `-W unused`
= help: to override `-W unused` add `#[allow(unused_variables)]`
```
* CLI option `-W unused-variables`:
```
= note: requested on the command line with `-W unused-variables`
```File tree
239 files changed
+443
-350
lines changed- compiler
- rustc_lint/src
- rustc_middle/src
- rustc_session/src
- src/tools/clippy/tests/ui/checked_unwrap
- tests/ui
- abi
- associated-consts
- associated-type-bounds
- associated-types
- attributes
- auto-traits
- borrowck
- cast
- closures
- 2229_closure_analysis/match
- coercion
- coherence
- const-generics
- generic_const_exprs
- issues
- min_const_generics
- consts
- const-eval
- coroutine
- delegation
- diagnostic_namespace
- do_not_recommend
- on_unimplemented
- did_you_mean
- drop
- dyn-compatibility
- dynamically-sized-types
- editions
- errors
- expr/if
- extern
- feature-gates
- fn
- generics
- impl-trait
- in-trait
- imports
- inference
- issues
- iterators
- lang-items
- lifetimes
- link-native-libs
- linkage-attr/raw-dylib/windows
- lint
- let_underscore
- rfc-2457-non-ascii-idents
- semicolon-in-expressions-from-macros
- unused
- macros
- malformed
- methods
- mir
- moves
- never_type
- nll
- overloaded
- parser
- recover
- removed-syntax
- pattern
- proc-macro
- pub
- repr
- rfcs/rfc-2497-if-let-chains
- self
- sized
- span
- statics
- stdlib-unit-tests
- std
- structs-enums
- suggestions
- traits
- alias
- bound
- const-traits
- default-method
- trait-upcasting
- type-alias-enum-variants
- unboxed-closures
- unsafe
- unsafe_op_in_unsafe_fn
- wf
- where-clauses
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
239 files changed
+443
-350
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
219 | 236 | | |
220 | 237 | | |
221 | 238 | | |
| |||
224 | 241 | | |
225 | 242 | | |
226 | 243 | | |
227 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
228 | 253 | | |
229 | 254 | | |
230 | 255 | | |
| |||
427 | 452 | | |
428 | 453 | | |
429 | 454 | | |
430 | | - | |
| 455 | + | |
431 | 456 | | |
432 | 457 | | |
433 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
167 | | - | |
| 171 | + | |
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
| |||
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
243 | 253 | | |
244 | 254 | | |
245 | 255 | | |
| |||
596 | 606 | | |
597 | 607 | | |
598 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
599 | 616 | | |
600 | 617 | | |
601 | 618 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
0 commit comments