about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2018-11-25 15:14:39 +0100
committerDavid Wood <david@davidtw.co>2018-12-30 14:30:58 +0100
commitdc41606ff403536afe4eda88a68b8faa8e3f9d55 (patch)
tree8d3cf44d31e1ad92e0b000512c384f14cbe4c90c /src/rustllvm/RustWrapper.cpp
parent162dcdc16f9b004b35160c9dd69faab29fc459e4 (diff)
downloadrust-dc41606ff403536afe4eda88a68b8faa8e3f9d55.tar.gz
rust-dc41606ff403536afe4eda88a68b8faa8e3f9d55.zip
Support user type annotations in `ref` bindings.
This commit adds support for user type annotations in variables declared
using `ref` bindings. When a variable declared using a `ref` binding,
then the `LocalDecl` has the type `&T` where the `&` was introduced by
the `ref` binding but the canonicalized type annotation has only a
`T` since the reference is implicit with the `ref` binding.

Therefore, to support type annotations, the canonicalized type
annotation either needs wrapped in a reference, or the `LocalDecl` type
must have a wrapped reference removed for comparison. It is easier to
remove the outer reference from the `LocalDecl` for the purpose of
comparison, so that is the approach this commit takes.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions