@@ -1187,51 +1187,6 @@ declare_lint! {
1187
1187
"lints that have been renamed or removed"
1188
1188
}
1189
1189
1190
- declare_lint ! {
1191
- /// The `unaligned_references` lint detects unaligned references to fields
1192
- /// of [packed] structs.
1193
- ///
1194
- /// [packed]: https://doc.rust-lang.org/reference/type-layout.html#the-alignment-modifiers
1195
- ///
1196
- /// ### Example
1197
- ///
1198
- /// ```rust,compile_fail
1199
- /// #[repr(packed)]
1200
- /// pub struct Foo {
1201
- /// field1: u64,
1202
- /// field2: u8,
1203
- /// }
1204
- ///
1205
- /// fn main() {
1206
- /// unsafe {
1207
- /// let foo = Foo { field1: 0, field2: 0 };
1208
- /// let _ = &foo.field1;
1209
- /// println!("{}", foo.field1); // An implicit `&` is added here, triggering the lint.
1210
- /// }
1211
- /// }
1212
- /// ```
1213
- ///
1214
- /// {{produces}}
1215
- ///
1216
- /// ### Explanation
1217
- ///
1218
- /// Creating a reference to an insufficiently aligned packed field is [undefined behavior] and
1219
- /// should be disallowed. Using an `unsafe` block does not change anything about this. Instead,
1220
- /// the code should do a copy of the data in the packed field or use raw pointers and unaligned
1221
- /// accesses. See [issue #82523] for more information.
1222
- ///
1223
- /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
1224
- /// [issue #82523]: https://github.com/rust-lang/rust/issues/82523
1225
- pub UNALIGNED_REFERENCES ,
1226
- Deny ,
1227
- "detects unaligned references to fields of packed structs" ,
1228
- @future_incompatible = FutureIncompatibleInfo {
1229
- reference: "issue #82523 <https://github.com/rust-lang/rust/issues/82523>" ,
1230
- reason: FutureIncompatibilityReason :: FutureReleaseErrorReportNow ,
1231
- } ;
1232
- report_in_external_macro
1233
- }
1234
-
1235
1190
declare_lint ! {
1236
1191
/// The `const_item_mutation` lint detects attempts to mutate a `const`
1237
1192
/// item.
@@ -3308,7 +3263,6 @@ declare_lint_pass! {
3308
3263
PUB_USE_OF_PRIVATE_EXTERN_CRATE ,
3309
3264
INVALID_TYPE_PARAM_DEFAULT ,
3310
3265
RENAMED_AND_REMOVED_LINTS ,
3311
- UNALIGNED_REFERENCES ,
3312
3266
CONST_ITEM_MUTATION ,
3313
3267
PATTERNS_IN_FNS_WITHOUT_BODY ,
3314
3268
MISSING_FRAGMENT_SPECIFIER ,
0 commit comments