Document projection condition
This commit is contained in:
parent
dab1074b91
commit
1905f8c441
1 changed files with 3 additions and 0 deletions
|
@ -106,6 +106,9 @@ impl<'pat, 'tcx> MatchPair<'pat, 'tcx> {
|
|||
let mut place = match place.try_upvars_resolved(cx) {
|
||||
Ok(val) | Err(val) => val,
|
||||
};
|
||||
|
||||
// Only add the OpaqueCast projection if the given place is an opaque type and the
|
||||
// expected type from the pattern is not.
|
||||
let may_need_cast = match place.base() {
|
||||
PlaceBase::Local(local) => {
|
||||
let ty = Place::ty_from(local, place.projection(), &cx.local_decls, cx.tcx).ty;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue