diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-03-27 20:37:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-27 20:37:05 +0100 |
| commit | a900677eb962741bd522c653b7933e97af130f24 (patch) | |
| tree | 32bf7154e3babb53249eb97de41d12dca1561d95 /compiler/rustc_errors/src/snippet.rs | |
| parent | 520c9a25dfc78ca1e1d198e55bb4bcb844b0791e (diff) | |
| parent | fb4f48e0321fcc6b57e823434674ce41ceb23176 (diff) | |
| download | rust-a900677eb962741bd522c653b7933e97af130f24.tar.gz rust-a900677eb962741bd522c653b7933e97af130f24.zip | |
Rollup merge of #82525 - RalfJung:unaligned-ref-warn, r=petrochenkov
make unaligned_references future-incompat lint warn-by-default and also remove the safe_packed_borrows lint that it replaces. `std::ptr::addr_of!` has hit beta now and will hit stable in a month, so I propose we start fixing https://github.com/rust-lang/rust/issues/27060 for real: creating a reference to a field of a packed struct needs to eventually become a hard error; this PR makes it a warn-by-default future-incompat lint. (The lint already existed, this just raises its default level.) At the same time I removed the corresponding code from unsafety checking; really there's no reason an `unsafe` block should make any difference here. For references to packed fields outside `unsafe` blocks, this means `unaligned_refereces` replaces the previous `safe_packed_borrows` warning with a link to https://github.com/rust-lang/rust/issues/82523 (and no more talk about unsafe blocks making any difference). So behavior barely changes, the warning is just worded differently. For references to packed fields inside `unsafe` blocks, this PR shows a new future-incompat warning. Closes https://github.com/rust-lang/rust/issues/46043 because that lint no longer exists.
Diffstat (limited to 'compiler/rustc_errors/src/snippet.rs')
0 files changed, 0 insertions, 0 deletions
