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

@ -2728,9 +2728,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.24" version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70"
dependencies = [ dependencies = [
"unicode-xid", "unicode-xid",
] ]
@ -5090,9 +5090,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.65" version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3a1d708c221c5a612956ef9f75b37e454e88d1f7b899fbd3a18d4252012d663" checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@ -1057,9 +1057,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
match param.kind { match param.kind {
GenericParamKind::Lifetime { .. } => { GenericParamKind::Lifetime { .. } => {
let (name, reg) = Region::early(&self.tcx.hir(), &mut index, &param); let (name, reg) = Region::early(&self.tcx.hir(), &mut index, &param);
let def_id = if let Region::EarlyBound(_, def_id, _) = reg { let Region::EarlyBound(_, def_id, _) = reg else {
def_id
} else {
bug!(); bug!();
}; };
// We cannot predict what lifetimes are unused in opaque type. // We cannot predict what lifetimes are unused in opaque type.

View File

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

View File

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