Skip to content

Commit 4070157

Browse files
github-actions[bot]celinvaltautschnigqinheping
authored
Automatic toolchain upgrade to nightly-2024-11-16 (#3722)
Update Rust toolchain from nightly-2024-11-15 to nightly-2024-11-16 without any other source changes. --------- Co-authored-by: celinval <[email protected]> Co-authored-by: Michael Tautschnig <[email protected]> Co-authored-by: Qinheping Hu <[email protected]>
1 parent d4605b3 commit 4070157

File tree

7 files changed

+12
-22
lines changed

7 files changed

+12
-22
lines changed

cprover_bindings/src/goto_program/typ.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -898,13 +898,9 @@ impl Type {
898898
} else if concrete_self.is_scalar() && concrete_other.is_scalar() {
899899
concrete_self == concrete_other
900900
} else if concrete_self.is_struct_like() && concrete_other.is_scalar() {
901-
concrete_self
902-
.unwrap_transparent_type(st)
903-
.map_or(false, |wrapped| wrapped == *concrete_other)
901+
concrete_self.unwrap_transparent_type(st) == Some(concrete_other.clone())
904902
} else if concrete_self.is_scalar() && concrete_other.is_struct_like() {
905-
concrete_other
906-
.unwrap_transparent_type(st)
907-
.map_or(false, |wrapped| wrapped == *concrete_self)
903+
concrete_other.unwrap_transparent_type(st) == Some(concrete_self.clone())
908904
} else if concrete_self.is_struct_like() && concrete_other.is_struct_like() {
909905
let self_components = concrete_self.get_non_empty_components(st).unwrap();
910906
let other_components = concrete_other.get_non_empty_components(st).unwrap();

cprover_bindings/src/irep/goto_binary_serde.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,7 @@ where
704704
/// Reads a reference encoded string from the byte stream.
705705
fn read_numbered_string_ref(&mut self) -> io::Result<NumberedString> {
706706
let string_number_result = self.read_usize_varenc();
707-
let string_number = match string_number_result {
708-
Ok(number) => number,
709-
Err(error) => return Err(error),
710-
};
707+
let string_number = string_number_result?;
711708
if self.is_first_read_string(string_number) {
712709
// read raw string
713710
let mut string_buf: Vec<u8> = Vec::new();
@@ -779,10 +776,7 @@ where
779776
/// Reads a NumberedIrep from the byte stream.
780777
fn read_numbered_irep_ref(&mut self) -> io::Result<NumberedIrep> {
781778
let irep_number_result = self.read_usize_varenc();
782-
let irep_number = match irep_number_result {
783-
Ok(number) => number,
784-
Err(error) => return Err(error),
785-
};
779+
let irep_number = irep_number_result?;
786780

787781
if self.is_first_read_irep(irep_number) {
788782
let id = self.read_numbered_string_ref()?.number;

kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1742,11 +1742,11 @@ impl<'tcx> GotocCtx<'tcx> {
17421742
/// TODO: Should we use `std_pointee_type` here?
17431743
/// <https://github.com/model-checking/kani/issues/1529>
17441744
pub fn is_fat_pointer(&self, pointer_ty: Ty<'tcx>) -> bool {
1745-
pointee_type(pointer_ty).map_or(false, |pointee_ty| self.use_fat_pointer(pointee_ty))
1745+
pointee_type(pointer_ty).is_some_and(|pointee_ty| self.use_fat_pointer(pointee_ty))
17461746
}
17471747

17481748
/// Check if the mir type already is a vtable fat pointer.
17491749
pub fn is_vtable_fat_pointer(&self, mir_type: Ty<'tcx>) -> bool {
1750-
pointee_type(mir_type).map_or(false, |pointee_ty| self.use_vtable_fat_pointer(pointee_ty))
1750+
pointee_type(mir_type).is_some_and(|pointee_ty| self.use_vtable_fat_pointer(pointee_ty))
17511751
}
17521752
}

kani-compiler/src/codegen_cprover_gotoc/overrides/hooks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ pub struct LoopInvariantRegister;
561561
impl GotocHook for LoopInvariantRegister {
562562
fn hook_applies(&self, _tcx: TyCtxt, instance: Instance) -> bool {
563563
attributes::fn_marker(instance.def)
564-
.map_or(false, |marker| marker == "kani_register_loop_contract")
564+
.is_some_and(|marker| marker == "kani_register_loop_contract")
565565
}
566566

567567
fn handle(

kani-compiler/src/kani_middle/abi.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ impl LayoutOf {
3030
/// This will also return `true` if the type is foreign.
3131
pub fn has_foreign_tail(&self) -> bool {
3232
self.unsized_tail()
33-
.map_or(false, |t| matches!(t.kind(), TyKind::RigidTy(RigidTy::Foreign(_))))
33+
.is_some_and(|t| matches!(t.kind(), TyKind::RigidTy(RigidTy::Foreign(_))))
3434
}
3535

3636
/// Return whether the type is unsized and its tail is a trait object.
3737
pub fn has_trait_tail(&self) -> bool {
38-
self.unsized_tail().map_or(false, |t| t.kind().is_trait())
38+
self.unsized_tail().is_some_and(|t| t.kind().is_trait())
3939
}
4040

4141
/// Return whether the type is unsized and its tail is a slice.
4242
#[allow(dead_code)]
4343
pub fn has_slice_tail(&self) -> bool {
44-
self.unsized_tail().map_or(false, |tail| {
44+
self.unsized_tail().is_some_and(|tail| {
4545
let kind = tail.kind();
4646
kind.is_slice() | kind.is_str()
4747
})

kani-compiler/src/kani_middle/resolve/type_resolution.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub(super) fn is_type_primitive(typ: &syn::Type) -> bool {
173173
}
174174
Type::Path(TypePath { qself: None, path }) => path
175175
.get_ident()
176-
.map_or(false, |ident| PrimitiveIdent::from_str(&ident.to_string()).is_ok()),
176+
.is_some_and(|ident| PrimitiveIdent::from_str(&ident.to_string()).is_ok()),
177177
Type::BareFn(_)
178178
| Type::Group(_)
179179
| Type::ImplTrait(_)

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
[toolchain]
5-
channel = "nightly-2024-11-15"
5+
channel = "nightly-2024-11-16"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

0 commit comments

Comments
 (0)