File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,11 @@ pub struct FutureIncompatibleInfo {
145
145
/// The reason for the lint used by diagnostics to provide
146
146
/// the right help message
147
147
pub reason : FutureIncompatibilityReason ,
148
+ /// Whether to explain the reason to the user.
149
+ ///
150
+ /// Set to false for lints that already include a more detailed
151
+ /// explanation.
152
+ pub explain_reason : bool ,
148
153
/// Information about a future breakage, which will
149
154
/// be emitted in JSON messages to be displayed by Cargo
150
155
/// for upstream deps
@@ -185,6 +190,7 @@ impl FutureIncompatibleInfo {
185
190
FutureIncompatibleInfo {
186
191
reference : "" ,
187
192
reason : FutureIncompatibilityReason :: FutureReleaseError ,
193
+ explain_reason : true ,
188
194
future_breakage : None ,
189
195
}
190
196
}
Original file line number Diff line number Diff line change @@ -398,9 +398,14 @@ pub fn struct_lint_level<'s, 'd>(
398
398
it will become a hard error in a future release!"
399
399
. to_owned ( )
400
400
} ;
401
- let citation = format ! ( "for more information, see {}" , future_incompatible. reference) ;
402
- err. warn ( & explanation) ;
403
- err. note ( & citation) ;
401
+ if future_incompatible. explain_reason {
402
+ err. warn ( & explanation) ;
403
+ }
404
+ if !future_incompatible. reference . is_empty ( ) {
405
+ let citation =
406
+ format ! ( "for more information, see {}" , future_incompatible. reference) ;
407
+ err. note ( & citation) ;
408
+ }
404
409
}
405
410
406
411
// Finally, run `decorate`. This function is also responsible for emitting the diagnostic.
You can’t perform that action at this time.
0 commit comments