@@ -85,13 +85,30 @@ Some messages are emitted via [lints](#lints), where the user can control the
85
85
level. Most diagnostics are hard-coded such that the user cannot control the
86
86
level.
87
87
88
+ Usually it is obvious whether a diagnostic should be "fixed" or a lint, but
89
+ there are some grey areas.
90
+
91
+ Here are a few examples:
92
+
93
+ - Borrow checker errors: these are fixed errors. The user cannot adjust the
94
+ level of these diagnostics to silence the borrow checker.
95
+ - Dead code: this is a lint. While the user probably doesn't want dead code in
96
+ their crate, making this a hard error would make refactoring and development
97
+ very painful.
98
+ - [ safe_packed_borrows future compatibility warning] [ safe_packed_borrows ] :
99
+ this is a silencable lint related to safety. It was judged that the making
100
+ this a hard (fixed) error would cause too much breakage, so instead a
101
+ warning is emitted that eventually will be turned into a hard error.
102
+
88
103
Hard-coded warnings (those using the ` span_warn ` methods) should be avoided
89
104
for normal code, preferring to use lints instead. Some cases, such as warnings
90
105
with CLI flags, will require the use of hard-coded warnings.
91
106
92
107
See the ` deny ` [ lint level] ( #diagnostic-levels ) below for guidelines when to
93
108
use an error-level lint instead of a fixed error.
94
109
110
+ [ safe_packed_borrows ] : https://github.com/rust-lang/rust/issues/46043
111
+
95
112
## Diagnostic output style guide
96
113
97
114
- Write in plain simple English. If your message, when shown on a – possibly
0 commit comments