diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-05-26 22:11:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-26 22:11:22 +0200 |
| commit | 6e6bd630e67e79d553e52eaca191555991eedd8f (patch) | |
| tree | e6682f5f7a557158160f028de79f2a94c3b9c8d2 /src/test/incremental/thinlto | |
| parent | aeca4d6428c52cbf2c8d1f28657b0bdf92e4ea7c (diff) | |
| parent | d959a8f91d9945302f58a8f79613e75060c6b77d (diff) | |
| download | rust-6e6bd630e67e79d553e52eaca191555991eedd8f.tar.gz rust-6e6bd630e67e79d553e52eaca191555991eedd8f.zip | |
Rollup merge of #72270 - RalfJung:lint-ref-to-packed, r=oli-obk
add a lint against references to packed fields Creating a reference to an insufficiently aligned packed field is UB and should be disallowed, both inside and outside of `unsafe` blocks. However, currently there is no stable alternative (https://github.com/rust-lang/rust/issues/64490) so all we do right now is have a future incompatibility warning when doing this outside `unsafe` (https://github.com/rust-lang/rust/issues/46043). This adds an allow-by-default lint. @retep998 suggested this can help early adopters avoid issues. It also means we can then do a crater run where this is deny-by-default as suggested by @joshtriplett. I guess the main thing to bikeshed is the lint name. I am not particularly happy with "packed_references" as it sounds like the packed field has reference type. I chose this because it is similar to "safe_packed_borrows". What about "reference_to_packed" or "unaligned_reference" or so?
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
