summaryrefslogtreecommitdiff
path: root/src/mir/mir.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2019-11-09 21:09:03 +0800
committerJohn Hodge <tpg@mutabah.net>2019-11-09 21:09:03 +0800
commit6d1213a9cd039b68d9826de0a7f9204e101e6624 (patch)
treeff9ac05088da0ec293291ea66edc422a9ff7351e /src/mir/mir.hpp
parent6be15b07fb5d56e1b2064ef2dd9bbf8ec8658d9a (diff)
downloadmrust-6d1213a9cd039b68d9826de0a7f9204e101e6624.tar.gz
Misc - Fix some warnings from MSVC
Diffstat (limited to 'src/mir/mir.hpp')
-rw-r--r--src/mir/mir.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mir/mir.hpp b/src/mir/mir.hpp
index 99698134..b2a89542 100644
--- a/src/mir/mir.hpp
+++ b/src/mir/mir.hpp
@@ -94,8 +94,8 @@ struct LValue
bool is_Static() const { return (val & 3) == 2; }
const char as_Return () const { assert(is_Return()); return 0; }
- const unsigned as_Argument() const { assert(is_Argument()); return (val >> 2) - 1; }
- const unsigned as_Local () const { assert(is_Local()); return val >> 2; }
+ const unsigned as_Argument() const { assert(is_Argument()); return static_cast<unsigned>( (val >> 2) - 1 ); }
+ const unsigned as_Local () const { assert(is_Local()); return static_cast<unsigned>(val >> 2); }
const ::HIR::Path& as_Static() const { assert(is_Static()); return *reinterpret_cast<const ::HIR::Path*>(val & ~3llu); }
::HIR::Path& as_Static() { assert(is_Static()); return *reinterpret_cast< ::HIR::Path*>(val & ~3llu); }