about summary refs log tree commit diff
path: root/src/test/ui/thinlto
diff options
context:
space:
mode:
authorMichal 'vorner' Vaner <vorner@vorner.cz>2019-06-01 11:55:25 +0200
committerMichal 'vorner' Vaner <vorner@vorner.cz>2019-06-13 13:18:59 +0200
commit79e58399920d6a0a7c4050bfb26c64fbc10562ec (patch)
treed1d561925b658082396d0d7e1ed37fd0dbd7f408 /src/test/ui/thinlto
parent8b40a188cee5bef97526dfc271afbd2a98008183 (diff)
downloadrust-79e58399920d6a0a7c4050bfb26c64fbc10562ec.tar.gz
rust-79e58399920d6a0a7c4050bfb26c64fbc10562ec.zip
docs: Use String in Rc::into_raw examples
It is unclear if accessing an integer after `drop_in_place` has been
called on it is undefined behaviour or not, as demonstrated by the
discussion in
https://github.com/rust-lang/rust/pull/60766#pullrequestreview-243414222.

Avoid these uncertainties by using String which frees memory in its
`drop_in_place` to make sure this is undefined behaviour. The message in
the docs should be to watch out and not access the data after that, not
discussing when one maybe could get away with it O:-).
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions