From 181935644b0a920badee9486ab44fd8fdeeff024 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Mon, 13 Nov 2023 09:19:55 +0100 Subject: [PATCH] Fix new beta warnings --- diesel/src/connection/mod.rs | 1 + diesel/src/macros/mod.rs | 2 +- diesel/src/query_builder/distinct_clause.rs | 2 +- diesel/src/query_source/aliasing/alias.rs | 2 ++ diesel/src/row.rs | 1 + diesel_tests/tests/types_roundtrip.rs | 1 + 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/diesel/src/connection/mod.rs b/diesel/src/connection/mod.rs index aa57744e8d39..788014c0f927 100644 --- a/diesel/src/connection/mod.rs +++ b/diesel/src/connection/mod.rs @@ -547,6 +547,7 @@ pub(crate) mod private { // These impls are only there for backward compatibility reasons // Remove them on the next breaking release + #[allow(unreachable_pub)] // must be pub for the type def using this trait #[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))] pub trait ConnectionHelperType: super::LoadConnection { type Cursor<'conn, 'query> diff --git a/diesel/src/macros/mod.rs b/diesel/src/macros/mod.rs index c1c3ad274c43..79d02859dfd5 100644 --- a/diesel/src/macros/mod.rs +++ b/diesel/src/macros/mod.rs @@ -4,7 +4,7 @@ pub(crate) mod prelude { allow(deprecated) )] // This is a false positive, we reexport it later - #[allow(unreachable_pub)] + #[allow(unreachable_pub, unused_imports)] #[doc(inline)] pub use crate::{ allow_columns_to_appear_in_same_group_by_clause, allow_tables_to_appear_in_same_query, diff --git a/diesel/src/query_builder/distinct_clause.rs b/diesel/src/query_builder/distinct_clause.rs index 35bcb3b0b2e7..a772afc308bd 100644 --- a/diesel/src/query_builder/distinct_clause.rs +++ b/diesel/src/query_builder/distinct_clause.rs @@ -31,6 +31,6 @@ impl ValidOrderingForDistinct for O {} impl ValidOrderingForDistinct for O {} // This is rexported from another location -#[allow(unreachable_pub)] +#[allow(unreachable_pub, unused_imports)] #[cfg(feature = "postgres_backend")] pub use crate::pg::DistinctOnClause; diff --git a/diesel/src/query_source/aliasing/alias.rs b/diesel/src/query_source/aliasing/alias.rs index 675158ecd68e..42f645292efc 100644 --- a/diesel/src/query_source/aliasing/alias.rs +++ b/diesel/src/query_source/aliasing/alias.rs @@ -207,9 +207,11 @@ where /// To be able to define `helper_types::Fields` with the usual conventions /// /// This type is intentionally not publicly exported +#[allow(unreachable_pub)] pub trait GetAliasSourceFromAlias { type Source; } + impl GetAliasSourceFromAlias for Alias { type Source = S; } diff --git a/diesel/src/row.rs b/diesel/src/row.rs index ec5c4bf6f025..a6bbcc3d31bb 100644 --- a/diesel/src/row.rs +++ b/diesel/src/row.rs @@ -265,6 +265,7 @@ pub(crate) mod private { // These impls are only there for backward compatibility reasons // Remove them on the next breaking release #[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))] + #[allow(unreachable_pub)] pub trait RowLifetimeHelper: for<'a> super::Row<'a, DB> where DB: Backend, diff --git a/diesel_tests/tests/types_roundtrip.rs b/diesel_tests/tests/types_roundtrip.rs index ef053e1b1826..4687f2ddc8ab 100644 --- a/diesel_tests/tests/types_roundtrip.rs +++ b/diesel_tests/tests/types_roundtrip.rs @@ -5,6 +5,7 @@ pub use quickcheck::quickcheck; pub use crate::schema::{connection_without_transaction, TestConnection}; pub use diesel::data_types::*; pub use diesel::result::Error; +#[cfg(not(feature = "postgres"))] pub use diesel::serialize::ToSql; pub use diesel::sql_types::{HasSqlType, SingleValue, SqlType}; pub use diesel::*;