diff --git a/diesel/src/pg/types/floats/mod.rs b/diesel/src/pg/types/floats/mod.rs index e5810b7837a3..47d7bca9aa0e 100644 --- a/diesel/src/pg/types/floats/mod.rs +++ b/diesel/src/pg/types/floats/mod.rs @@ -37,6 +37,7 @@ pub enum PgNumeric { } #[derive(Debug, Clone, Copy)] +#[allow(dead_code)] // that's used by debug in the error impl struct InvalidNumericSign(u16); impl ::std::fmt::Display for InvalidNumericSign { diff --git a/diesel/src/sqlite/connection/raw.rs b/diesel/src/sqlite/connection/raw.rs index 9f31a58106a4..bf5e910d3fab 100644 --- a/diesel/src/sqlite/connection/raw.rs +++ b/diesel/src/sqlite/connection/raw.rs @@ -261,7 +261,7 @@ impl Drop for RawConnection { enum SqliteCallbackError { Abort(&'static str), DieselError(crate::result::Error), - Panic(Box, String), + Panic(String), } impl SqliteCallbackError { @@ -273,7 +273,7 @@ impl SqliteCallbackError { s = e.to_string(); &s } - SqliteCallbackError::Panic(_, msg) => msg, + SqliteCallbackError::Panic(msg) => msg, }; unsafe { context_error_str(ctx, msg); @@ -347,12 +347,7 @@ extern "C" fn run_custom_function( } Ok(()) }) - .unwrap_or_else(|p| { - Err(SqliteCallbackError::Panic( - p, - data_ptr.function_name.clone(), - )) - }); + .unwrap_or_else(|p| Err(SqliteCallbackError::Panic(data_ptr.function_name.clone()))); if let Err(e) = result { e.emit(ctx); } @@ -383,10 +378,10 @@ extern "C" fn run_aggregator_step_function(ctx, args) }) .unwrap_or_else(|e| { - Err(SqliteCallbackError::Panic( - e, - format!("{}::step() panicked", std::any::type_name::()), - )) + Err(SqliteCallbackError::Panic(format!( + "{}::step() panicked", + std::any::type_name::() + ))) }); match result { @@ -496,11 +491,11 @@ extern "C" fn run_aggregator_final_function()), - )) + .unwrap_or_else(|_e| { + Err(SqliteCallbackError::Panic(format!( + "{}::finalize() panicked", + std::any::type_name::() + ))) }); if let Err(e) = result { e.emit(ctx); @@ -570,7 +565,6 @@ where }) .unwrap_or_else(|p| { Err(SqliteCallbackError::Panic( - p, user_ptr .map(|u| u.collation_name.clone()) .unwrap_or_default(), @@ -601,7 +595,7 @@ where ); std::process::abort() } - Err(SqliteCallbackError::Panic(_, msg)) => { + Err(SqliteCallbackError::Panic(msg)) => { eprintln!("Collation function {} panicked", msg); std::process::abort() } diff --git a/diesel_derives/src/parsers/belongs_to.rs b/diesel_derives/src/parsers/belongs_to.rs index 50e00957c2d2..653e30deecfa 100644 --- a/diesel_derives/src/parsers/belongs_to.rs +++ b/diesel_derives/src/parsers/belongs_to.rs @@ -6,7 +6,7 @@ use syn::{Ident, TypePath}; use crate::util::{parse_eq, unknown_attribute, BELONGS_TO_NOTE}; enum Attr { - ForeignKey(Ident, Ident), + ForeignKey(Ident), } impl Parse for Attr { @@ -15,7 +15,7 @@ impl Parse for Attr { let name_str = name.to_string(); match &*name_str { - "foreign_key" => Ok(Attr::ForeignKey(name, parse_eq(input, BELONGS_TO_NOTE)?)), + "foreign_key" => Ok(Attr::ForeignKey(parse_eq(input, BELONGS_TO_NOTE)?)), _ => Err(unknown_attribute(&name, &["foreign_key"])), } @@ -39,7 +39,7 @@ impl Parse for BelongsTo { for attr in Punctuated::::parse_terminated(input)? { match attr { - Attr::ForeignKey(_, value) => foreign_key = Some(value), + Attr::ForeignKey(value) => foreign_key = Some(value), } } diff --git a/diesel_derives/src/parsers/mysql_type.rs b/diesel_derives/src/parsers/mysql_type.rs index baa2dbe66e2f..0266d9598175 100644 --- a/diesel_derives/src/parsers/mysql_type.rs +++ b/diesel_derives/src/parsers/mysql_type.rs @@ -6,7 +6,7 @@ use syn::{Ident, LitStr}; use crate::util::{parse_eq, unknown_attribute, MYSQL_TYPE_NOTE}; enum Attr { - Name(Ident, LitStr), + Name(LitStr), } impl Parse for Attr { @@ -15,7 +15,7 @@ impl Parse for Attr { let name_str = name.to_string(); match &*name_str { - "name" => Ok(Attr::Name(name, parse_eq(input, MYSQL_TYPE_NOTE)?)), + "name" => Ok(Attr::Name(parse_eq(input, MYSQL_TYPE_NOTE)?)), _ => Err(unknown_attribute(&name, &["name"])), } @@ -32,7 +32,7 @@ impl Parse for MysqlType { for attr in Punctuated::::parse_terminated(input)? { match attr { - Attr::Name(_, value) => name = Some(value), + Attr::Name(value) => name = Some(value), } } diff --git a/diesel_derives/src/parsers/sqlite_type.rs b/diesel_derives/src/parsers/sqlite_type.rs index 063ed65f4734..a2b190c39874 100644 --- a/diesel_derives/src/parsers/sqlite_type.rs +++ b/diesel_derives/src/parsers/sqlite_type.rs @@ -6,7 +6,7 @@ use syn::{Ident, LitStr}; use crate::util::{parse_eq, unknown_attribute, SQLITE_TYPE_NOTE}; enum Attr { - Name(Ident, LitStr), + Name(LitStr), } impl Parse for Attr { @@ -15,7 +15,7 @@ impl Parse for Attr { let name_str = name.to_string(); match &*name_str { - "name" => Ok(Attr::Name(name, parse_eq(input, SQLITE_TYPE_NOTE)?)), + "name" => Ok(Attr::Name(parse_eq(input, SQLITE_TYPE_NOTE)?)), _ => Err(unknown_attribute(&name, &["name"])), } @@ -32,7 +32,7 @@ impl Parse for SqliteType { for attr in Punctuated::::parse_terminated(input)? { match attr { - Attr::Name(_, value) => name = Some(value), + Attr::Name(value) => name = Some(value), } } diff --git a/diesel_tests/tests/insert_from_select.rs b/diesel_tests/tests/insert_from_select.rs index 582ccd60d6ba..edf14da6fdac 100644 --- a/diesel_tests/tests/insert_from_select.rs +++ b/diesel_tests/tests/insert_from_select.rs @@ -395,6 +395,7 @@ fn on_conflict_do_update_with_boxed_select() { users .select((id, name.concat(" says hi"))) + .order(id) .into_boxed() .insert_into(posts) .into_columns((user_id, title)) @@ -411,6 +412,7 @@ fn on_conflict_do_update_with_boxed_select() { users .select((id, name.concat(" says hi"))) + .order(id) .into_boxed() .insert_into(posts) .into_columns((user_id, title))