about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2018-10-26 13:22:45 +0200
committerDavid Wood <david@davidtw.co>2018-10-27 12:11:37 +0200
commit6208bd8e03996e700950451e7614a6feb0163acb (patch)
tree52cd9420ac7d57cf5fb46a7fab5ef59d0a7f8738 /src/rustllvm/RustWrapper.cpp
parent8a0d8c5ab5541c28a64073d8af2592965941564c (diff)
downloadrust-6208bd8e03996e700950451e7614a6feb0163acb.tar.gz
rust-6208bd8e03996e700950451e7614a6feb0163acb.zip
Refactor and add `PlaceContext::AscribeUserTy`.
This commit refactors `PlaceContext` to split it into four different
smaller enums based on if the context represents a mutating use,
non-mutating use, maybe-mutating use or a non-use (this is based on the
recommendation from @oli-obk on Zulip[1]).

This commit then introduces a `PlaceContext::AscribeUserTy` variant.
`StatementKind::AscribeUserTy` is now correctly mapped to
`PlaceContext::AscribeUserTy` instead of `PlaceContext::Validate`.
`PlaceContext::AscribeUserTy` can also now be correctly categorized as a
non-use which fixes an issue with constant promotion in statics after a
cast introduces a `AscribeUserTy` statement.

[1]: https://rust-lang.zulipchat.com/#narrow/stream/122657-wg-nll/subject/.2355288.20cast.20fails.20to.20promote.20to.20'static/near/136536949
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions