about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-06 03:16:29 +0000
committerbors <bors@rust-lang.org>2022-09-06 03:16:29 +0000
commitce339b219ab9a3731e38f68a66fc39e0898ac7af (patch)
treecfb9df88a91a7c4236ba86fa920db699407c0c8c /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent2ccf843471131e48ce1bc78a93ca2829590ff741 (diff)
parente5f30f4dfa3b9311273b2546897b23ddafd17133 (diff)
downloadrust-ce339b219ab9a3731e38f68a66fc39e0898ac7af.tar.gz
rust-ce339b219ab9a3731e38f68a66fc39e0898ac7af.zip
Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillot
`BindingAnnotation` refactor

* `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`)
* `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)`
* Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}`

One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`.

I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions