Skip to content

Commit ef018be

Browse files
committed
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 dtolnay/syn#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.
1 parent 1418df5 commit ef018be

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2728,9 +2728,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
27282728

27292729
[[package]]
27302730
name = "proc-macro2"
2731-
version = "1.0.24"
2731+
version = "1.0.30"
27322732
source = "registry+https://github.com/rust-lang/crates.io-index"
2733-
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
2733+
checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70"
27342734
dependencies = [
27352735
"unicode-xid",
27362736
]
@@ -5090,9 +5090,9 @@ dependencies = [
50905090

50915091
[[package]]
50925092
name = "syn"
5093-
version = "1.0.65"
5093+
version = "1.0.80"
50945094
source = "registry+https://github.com/rust-lang/crates.io-index"
5095-
checksum = "f3a1d708c221c5a612956ef9f75b37e454e88d1f7b899fbd3a18d4252012d663"
5095+
checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194"
50965096
dependencies = [
50975097
"proc-macro2",
50985098
"quote",

compiler/rustc_resolve/src/late/lifetimes.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1057,9 +1057,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
10571057
match param.kind {
10581058
GenericParamKind::Lifetime { .. } => {
10591059
let (name, reg) = Region::early(&self.tcx.hir(), &mut index, &param);
1060-
let def_id = if let Region::EarlyBound(_, def_id, _) = reg {
1061-
def_id
1062-
} else {
1060+
let Region::EarlyBound(_, def_id, _) = reg else {
10631061
bug!();
10641062
};
10651063
// We cannot predict what lifetimes are unused in opaque type.

compiler/rustc_typeck/src/check/coercion.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
521521

522522
let traits =
523523
(self.tcx.lang_items().unsize_trait(), self.tcx.lang_items().coerce_unsized_trait());
524-
let (unsize_did, coerce_unsized_did) = if let (Some(u), Some(cu)) = traits {
525-
(u, cu)
526-
} else {
524+
let (Some(unsize_did), Some(coerce_unsized_did)) = traits else {
527525
debug!("missing Unsize or CoerceUnsized traits");
528526
return Err(TypeError::Mismatch);
529527
};

compiler/rustc_typeck/src/check/upvar.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1678,9 +1678,7 @@ impl<'a, 'tcx> InferBorrowKind<'a, 'tcx> {
16781678
diag_expr_id: hir::HirId,
16791679
) {
16801680
let tcx = self.fcx.tcx;
1681-
let upvar_id = if let PlaceBase::Upvar(upvar_id) = place_with_id.place.base {
1682-
upvar_id
1683-
} else {
1681+
let PlaceBase::Upvar(upvar_id) = place_with_id.place.base else {
16841682
return;
16851683
};
16861684

0 commit comments

Comments
 (0)