Commit dc37fdf
authored
Rollup merge of rust-lang#140794 - karolzwolak:allow-unused-doc-65464, r=davidtwco
Add information about group a lint belongs to
# Description
Fixes: rust-lang#65464
## Changes Made
- Extended the default lint settings message to include the lint group they belong to
- Modified the proposed fix message wording from "part of" to "implied by" for better accuracy
- Old message: `` `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default ``
- New message: `` `#[warn(unused_variables)]` (implied by `#[warn(unused)]`) on by default ``
## Rationale
1. The new wording ("implied by") better reflects the actual relationship between lint groups and their members
2. It maintains consistency with messages shown when manually setting lint levels
3. The change helps users understand the hierarchy of lint settings
## Implementation Notes
- Only affects messages for default lint levels (not shown when levels are overridden)
- External lints remain unchanged (potential discussion point for future changes)
## Examples
### Case 1: Unchanged behavior when lint level is overridden
```rust
#[deny(unused)]
fn main() {
let x = 5;
}
```
Result:
```
note: the lint level is defined here
--> src/main.rs:1:8
|
1 | #[deny(unused)]
| ^^^^^^
= note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
```
### Case 2: Changed behavior for default lint levels
```rust
fn main() {
let x = 5;
}
```
New output:
```
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
```
Previous output:
```
= note: `#[warn(unused_variables)]` on by default
```
## Discussion Points
- Should we extend this change to external lints as well?
- Is "part of" the most accurate terminology?
- Doesn't this additional info bloat the message? Perhaps a clippy lint suggesting overriding a whole group instead of a few lints manually would be betterFile 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