about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2018-07-11 12:38:36 -0600
committerGitHub <noreply@github.com>2018-07-11 12:38:36 -0600
commit7897ee4d42e42d183d539fdf9fd5389ca249232a (patch)
treeea1a2231fbfc235f4e85851311bf1518b01bf684 /src/rustllvm/RustWrapper.cpp
parent74cc821fd583844fb3e4a0ebbe78a1962e87c4bd (diff)
parentf68323b28adf9b5ac1d85abe48915bc189aed813 (diff)
downloadrust-7897ee4d42e42d183d539fdf9fd5389ca249232a.tar.gz
rust-7897ee4d42e42d183d539fdf9fd5389ca249232a.zip
Rollup merge of #52207 - RalfJung:unsafety-errors, r=estebank
improve error message shown for unsafe operations

Add a short explanation saying why undefined behavior could arise. In particular, the error many people got for "creating a pointer to a packed field requires unsafe block" was not worded great -- it lead to people just adding the unsafe block without considering if what they are doing follows the rules.

I am not sure if a "note" is the right thing, but that was the easiest thing to add...

Inspired by @gnzlbg at https://github.com/rust-lang/rust/issues/46043#issuecomment-381544673
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions