about summary refs log tree commit diff
path: root/src/test/ui/thinlto
diff options
context:
space:
mode:
authorJon Gjengset <jon@thesquareplanet.com>2019-05-24 13:52:06 -0400
committerJon Gjengset <jon@thesquareplanet.com>2019-05-29 18:14:55 -0400
commit5a01b547078e45cc1a96a062334d8571f129ddc2 (patch)
tree1b46c86a04500d3a5159a6f366b7bfc96a01a08b /src/test/ui/thinlto
parent37d001e4deb206ed954fde5d91690221e8306fc3 (diff)
downloadrust-5a01b547078e45cc1a96a062334d8571f129ddc2.tar.gz
rust-5a01b547078e45cc1a96a062334d8571f129ddc2.zip
Add std::mem::take as suggested in #61129
The name `swap_default` was suggested but rejected. @SimonSapin observed
that this operation isn't really a `swap` in the same sense as
`mem::swap`; it is a `replace`. Since `replace_default` is a bit
misleading, the "correct" name would be `replace_with_default`, which is
quite verbose.

@czipperz observed that we have precedence for using `take` to refer to
methods that replace with `Default` in `Cell::take` and `Option::take`,
so this reverts commit 99c00591c29b472c8a87c4a9342d0e0c508647a3 to
return to the original `take` method name.

The name `replace_with_default` was suggested, but was deemed too
verbose, especially given that we use `take` for methods that replace
with `Default` elsewhere.
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions