From 1593d814da9ef0f02b2af1a8e5b77da471416eb2 Mon Sep 17 00:00:00 2001 From: John-John Tedro Date: Mon, 12 Aug 2024 00:57:32 +0200 Subject: [PATCH] chore: silent nightly warnings --- crates/rune-alloc/src/alloc/mod.rs | 2 ++ crates/rune-alloc/src/btree/map.rs | 1 + crates/rune-alloc/src/btree/navigate.rs | 1 + crates/rune-alloc/src/hashbrown/map.rs | 1 + crates/rune-alloc/src/testing/mod.rs | 1 + crates/rune/src/ast/expr_binary.rs | 1 + crates/rune/src/runtime/to_value.rs | 1 + 7 files changed, 8 insertions(+) diff --git a/crates/rune-alloc/src/alloc/mod.rs b/crates/rune-alloc/src/alloc/mod.rs index 5e4c57467..49616da7a 100644 --- a/crates/rune-alloc/src/alloc/mod.rs +++ b/crates/rune-alloc/src/alloc/mod.rs @@ -42,6 +42,7 @@ impl SizedTypeProperties for T {} pub(crate) fn into_ok(result: Result) -> T { match result { Ok(value) => value, + #[allow(unreachable_patterns)] Err(error) => match error {}, } } @@ -52,6 +53,7 @@ pub(crate) fn into_ok_try(result: Result>) -> Resu Ok(value) => Ok(value), Err(error) => match error { CustomError::Error(error) => Err(error), + #[allow(unreachable_patterns)] CustomError::Custom(error) => match error {}, }, } diff --git a/crates/rune-alloc/src/btree/map.rs b/crates/rune-alloc/src/btree/map.rs index 2892f88f5..e9775c28d 100644 --- a/crates/rune-alloc/src/btree/map.rs +++ b/crates/rune-alloc/src/btree/map.rs @@ -60,6 +60,7 @@ macro_rules! into_iter { pub(crate) fn into_ok(result: Result) -> T { match result { Ok(value) => value, + #[allow(unreachable_patterns)] Err(error) => match error {}, } } diff --git a/crates/rune-alloc/src/btree/navigate.rs b/crates/rune-alloc/src/btree/navigate.rs index 8ee73416d..634ff4df6 100644 --- a/crates/rune-alloc/src/btree/navigate.rs +++ b/crates/rune-alloc/src/btree/navigate.rs @@ -14,6 +14,7 @@ enum Never {} fn into_ok(result: Result) -> T { match result { Ok(value) => value, + #[allow(unreachable_patterns)] Err(never) => match never {}, } } diff --git a/crates/rune-alloc/src/hashbrown/map.rs b/crates/rune-alloc/src/hashbrown/map.rs index 41d7bad3c..0892fe5f4 100644 --- a/crates/rune-alloc/src/hashbrown/map.rs +++ b/crates/rune-alloc/src/hashbrown/map.rs @@ -1846,6 +1846,7 @@ where None } Err(ErrorOrInsertSlot::Error(error)) => match error { + #[allow(unreachable_patterns)] CustomError::Custom(error) => match error {}, CustomError::Error(error) => return Err(error), }, diff --git a/crates/rune-alloc/src/testing/mod.rs b/crates/rune-alloc/src/testing/mod.rs index 9ed1b79a3..a71b73145 100644 --- a/crates/rune-alloc/src/testing/mod.rs +++ b/crates/rune-alloc/src/testing/mod.rs @@ -30,6 +30,7 @@ impl TestExt for Result { fn abort(self) -> T { match self { Ok(value) => value, + #[allow(unreachable_patterns)] Err(error) => match error {}, } } diff --git a/crates/rune/src/ast/expr_binary.rs b/crates/rune/src/ast/expr_binary.rs index bee8999c7..78cdce7f0 100644 --- a/crates/rune/src/ast/expr_binary.rs +++ b/crates/rune/src/ast/expr_binary.rs @@ -292,6 +292,7 @@ impl Peek for BinOp { fn peek(p: &mut Peeker<'_>) -> bool { match Self::from_peeker(p) { Ok(tok) => tok.is_some(), + #[allow(unreachable_patterns)] Err(infallible) => match infallible {}, } } diff --git a/crates/rune/src/runtime/to_value.rs b/crates/rune/src/runtime/to_value.rs index 7eeb9372a..30ce35294 100644 --- a/crates/rune/src/runtime/to_value.rs +++ b/crates/rune/src/runtime/to_value.rs @@ -236,6 +236,7 @@ macro_rules! number_value_trait { fn to_value(self) -> VmResult { match ::try_from(self) { Ok(number) => VmResult::Ok(vm_try!(Value::try_from(number))), + #[allow(unreachable_patterns)] Err(..) => VmResult::err(VmErrorKind::IntegerToValueCoercionError { from: VmIntegerRepr::from(self), to: any::type_name::(),