1
Fork 0

Update the syn crate and adopt let_else in three more places

The syn crate has gained support for let_else syntax in version 1.0.76,
see https://github.com/dtolnay/syn/pull/1057 .

In the three instances that use let_else, we've sent code through an
attr macro, which would create compile errors when there was no
let_else support in syn. To avoid this, we ran
`cargo +nightly update -p syn` for updating the syn crate.
This commit is contained in:
est31 2021-10-16 04:37:30 +02:00
parent 1418df5888
commit ef018be5c4
4 changed files with 7 additions and 13 deletions

View file

@ -521,9 +521,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
let traits =
(self.tcx.lang_items().unsize_trait(), self.tcx.lang_items().coerce_unsized_trait());
let (unsize_did, coerce_unsized_did) = if let (Some(u), Some(cu)) = traits {
(u, cu)
} else {
let (Some(unsize_did), Some(coerce_unsized_did)) = traits else {
debug!("missing Unsize or CoerceUnsized traits");
return Err(TypeError::Mismatch);
};

View file

@ -1678,9 +1678,7 @@ impl<'a, 'tcx> InferBorrowKind<'a, 'tcx> {
diag_expr_id: hir::HirId,
) {
let tcx = self.fcx.tcx;
let upvar_id = if let PlaceBase::Upvar(upvar_id) = place_with_id.place.base {
upvar_id
} else {
let PlaceBase::Upvar(upvar_id) = place_with_id.place.base else {
return;
};