diff --git a/diesel/Cargo.toml b/diesel/Cargo.toml index 3b81e339ac0b..e754f195a8ae 100644 --- a/diesel/Cargo.toml +++ b/diesel/Cargo.toml @@ -16,7 +16,7 @@ rust-version = "1.66.0" byteorder = { version = "1.0", optional = true } chrono = { version = "0.4.20", optional = true, default-features = false, features = ["clock", "std"] } libc = { version = "0.2.0", optional = true } -libsqlite3-sys = { version = ">=0.17.2, <0.27.0", optional = true, features = ["bundled_bindings"] } +libsqlite3-sys = { version = ">=0.17.2, <0.28.0", optional = true, features = ["bundled_bindings"] } mysqlclient-sys = { version = "0.2.5", optional = true } pq-sys = { version = "0.4.0", optional = true } quickcheck = { version = "1.0.3", optional = true } 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/src/sqlite/connection/raw.rs b/diesel/src/sqlite/connection/raw.rs index 047736b35632..9f31a58106a4 100644 --- a/diesel/src/sqlite/connection/raw.rs +++ b/diesel/src/sqlite/connection/raw.rs @@ -200,6 +200,8 @@ impl RawConnection { } pub(super) fn deserialize(&mut self, data: &[u8]) -> QueryResult<()> { + // the cast for `ffi::SQLITE_DESERIALIZE_READONLY` is required for old libsqlite3-sys versions + #[allow(clippy::unnecessary_cast)] unsafe { let result = ffi::sqlite3_deserialize( self.internal_connection.as_ptr(), diff --git a/diesel/src/sqlite/connection/stmt.rs b/diesel/src/sqlite/connection/stmt.rs index c580bb3e4aaf..a5ba556690c1 100644 --- a/diesel/src/sqlite/connection/stmt.rs +++ b/diesel/src/sqlite/connection/stmt.rs @@ -26,6 +26,8 @@ impl Statement { ) -> QueryResult { let mut stmt = ptr::null_mut(); let mut unused_portion = ptr::null(); + // the cast for `ffi::SQLITE_PREPARE_PERSISTENT` is required for old libsqlite3-sys versions + #[allow(clippy::unnecessary_cast)] let prepare_result = unsafe { ffi::sqlite3_prepare_v3( raw_connection.internal_connection.as_ptr(), diff --git a/diesel_cli/Cargo.toml b/diesel_cli/Cargo.toml index 1a2eeb75ff67..c72b7a352d5a 100644 --- a/diesel_cli/Cargo.toml +++ b/diesel_cli/Cargo.toml @@ -31,7 +31,7 @@ heck = "0.4.0" serde = { version = "1.0.0", features = ["derive"] } toml = "0.8" url = { version = "2.2.2" } -libsqlite3-sys = { version = ">=0.17.2, <0.27.0", optional = true } +libsqlite3-sys = { version = ">=0.17.2, <0.28.0", optional = true } diffy = "0.3.0" regex = "1.0.6" serde_regex = "1.1" diff --git a/diesel_tests/Cargo.toml b/diesel_tests/Cargo.toml index e2340c979037..5fdd4a5f35dd 100644 --- a/diesel_tests/Cargo.toml +++ b/diesel_tests/Cargo.toml @@ -21,7 +21,7 @@ ipnet = { version = "2.5.0" } ipnetwork = ">=0.12.2, <0.21.0" bigdecimal = ">= 0.0.13, < 0.5.0" rand = "0.8.4" -libsqlite3-sys = { version = "0.26", optional = true } +libsqlite3-sys = { version = "0.27", optional = true } [features] default = [] diff --git a/diesel_tests/tests/types_roundtrip.rs b/diesel_tests/tests/types_roundtrip.rs index ef053e1b1826..26c7e29791b5 100644 --- a/diesel_tests/tests/types_roundtrip.rs +++ b/diesel_tests/tests/types_roundtrip.rs @@ -3,9 +3,9 @@ use diesel::query_dsl::LoadQuery; pub use quickcheck::quickcheck; pub use crate::schema::{connection_without_transaction, TestConnection}; +#[cfg(not(feature = "sqlite"))] pub use diesel::data_types::*; pub use diesel::result::Error; -pub use diesel::serialize::ToSql; pub use diesel::sql_types::{HasSqlType, SingleValue, SqlType}; pub use diesel::*; diff --git a/examples/sqlite/all_about_inserts/Cargo.toml b/examples/sqlite/all_about_inserts/Cargo.toml index f8d2b8ad1397..80f6e615d21a 100644 --- a/examples/sqlite/all_about_inserts/Cargo.toml +++ b/examples/sqlite/all_about_inserts/Cargo.toml @@ -9,7 +9,7 @@ diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite", "c serde = { version = "1.0.130", features = ["derive"] } serde_json = "1.0.68" chrono = { version = "0.4.20", default-features = false, features = ["clock", "std"] } -libsqlite3-sys = { version = ">=0.17.2, <0.27.0", features = ["bundled"] } +libsqlite3-sys = { version = "0.27.0", features = ["bundled"] } [lib] doc = false diff --git a/examples/sqlite/getting_started_step_1/Cargo.toml b/examples/sqlite/getting_started_step_1/Cargo.toml index 356b2c1d20c5..a53a790cfa1c 100644 --- a/examples/sqlite/getting_started_step_1/Cargo.toml +++ b/examples/sqlite/getting_started_step_1/Cargo.toml @@ -9,7 +9,7 @@ publish = false [dependencies] diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite"] } dotenvy = "0.15" -libsqlite3-sys = { version = ">=0.17.2, <0.27.0", features = ["bundled"] } +libsqlite3-sys = { version = "0.27.0", features = ["bundled"] } [[bin]] name = "show_posts" diff --git a/examples/sqlite/getting_started_step_2/Cargo.toml b/examples/sqlite/getting_started_step_2/Cargo.toml index 22f301218625..ad212b010c17 100644 --- a/examples/sqlite/getting_started_step_2/Cargo.toml +++ b/examples/sqlite/getting_started_step_2/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite", "returning_clauses_for_sqlite_3_35"] } dotenvy = "0.15" -libsqlite3-sys = { version = ">=0.17.2, <0.27.0", features = ["bundled"] } +libsqlite3-sys = { version = "0.27.0", features = ["bundled"] } [[bin]] name = "show_posts" diff --git a/examples/sqlite/getting_started_step_3/Cargo.toml b/examples/sqlite/getting_started_step_3/Cargo.toml index 9752dfaf17d0..1c975637442c 100644 --- a/examples/sqlite/getting_started_step_3/Cargo.toml +++ b/examples/sqlite/getting_started_step_3/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite", "returning_clauses_for_sqlite_3_35"] } dotenvy = "0.15" -libsqlite3-sys = { version = ">=0.17.2, <0.27.0", features = ["bundled"] } +libsqlite3-sys = { version = "0.27.0", features = ["bundled"] } [[bin]] name = "show_posts"