Skip to content

Commit

Permalink
Merge pull request #2532 from weiznich/fix/1638
Browse files Browse the repository at this point in the history
Fix #1638
  • Loading branch information
weiznich authored Oct 8, 2020
2 parents 0cb4a25 + 7798cb3 commit fb944fd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ for Rust libraries in [RFC #1105](https://github.com/rust-lang/rfcs/blob/master/
* It is now possible to inspect the type of values returned from the database
in such a way to support constructing a dynamic value depending on this type.

* Added a `without-deprecated` feature that unconditionally disables deprecated items.
Use this feature flag to verify that none of your dependencies is setting
the `with-deprecated` flag internally.


### Removed

Expand Down
1 change: 1 addition & 0 deletions diesel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ huge-tables = ["64-column-tables"]
postgres = ["pq-sys", "bitflags", "diesel_derives/postgres"]
sqlite = ["libsqlite3-sys", "diesel_derives/sqlite"]
mysql = ["mysqlclient-sys", "url", "percent-encoding", "diesel_derives/mysql", "bitflags"]
without-deprecated = []
with-deprecated = []
network-address = ["ipnetwork", "libc"]
numeric = ["num-bigint", "bigdecimal", "num-traits", "num-integer"]
Expand Down
6 changes: 3 additions & 3 deletions diesel/src/expression/functions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub use diesel_derives::sql_function_proc as sql_function;

#[macro_export]
#[doc(hidden)]
#[cfg(feature = "with-deprecated")]
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
macro_rules! no_arg_sql_function_body_except_to_sql {
($type_name:ident, $return_type:ty, $docs:expr) => {
#[allow(non_camel_case_types)]
Expand All @@ -31,7 +31,7 @@ macro_rules! no_arg_sql_function_body_except_to_sql {

#[macro_export]
#[doc(hidden)]
#[cfg(feature = "with-deprecated")]
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
macro_rules! no_arg_sql_function_body {
($type_name:ident, $return_type:ty, $docs:expr, $($constraint:ident)::+) => {
no_arg_sql_function_body_except_to_sql!($type_name, $return_type, $docs);
Expand Down Expand Up @@ -78,7 +78,7 @@ macro_rules! no_arg_sql_function_body {
since = "2.0.0",
note = "Use `sql_function!` instead. See `CHANGELOG.md` for migration instructions"
)]
#[cfg(feature = "with-deprecated")]
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
macro_rules! no_arg_sql_function {
($type_name:ident, $return_type:ty) => {
no_arg_sql_function!($type_name, $return_type, "");
Expand Down
6 changes: 3 additions & 3 deletions diesel/src/expression/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ macro_rules! infix_operator {

#[macro_export(local_inner_macros)]
#[deprecated(since = "2.0.0", note = "use `diesel::infix_operator!` instead")]
#[cfg(feature = "with-deprecated")]
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
#[doc(hidden)]
macro_rules! diesel_infix_operator {
($($args:tt)*) => {
Expand Down Expand Up @@ -357,7 +357,7 @@ macro_rules! postfix_operator {

#[macro_export(local_inner_macros)]
#[deprecated(since = "2.0.0", note = "use `diesel::postfix_operator!` instead")]
#[cfg(feature = "with-deprecated")]
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
#[doc(hidden)]
macro_rules! diesel_postfix_operator {
($($args:tt)*) => {
Expand Down Expand Up @@ -412,7 +412,7 @@ macro_rules! prefix_operator {

#[macro_export(local_inner_macros)]
#[deprecated(since = "2.0.0", note = "use `diesel::prefix_operator!` instead")]
#[cfg(feature = "with-deprecated")]
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
#[doc(hidden)]
macro_rules! diesel_prefix_operator {
($($args:tt)*) => {
Expand Down
2 changes: 1 addition & 1 deletion diesel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ mod type_impls;
mod util;

#[doc(hidden)]
#[cfg(feature = "with-deprecated")]
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
#[deprecated(since = "2.0.0", note = "Use explicit macro imports instead")]
pub use diesel_derives::*;

Expand Down
2 changes: 1 addition & 1 deletion diesel/src/pg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub use self::query_builder::PgQueryBuilder;
pub use self::transaction::TransactionBuilder;
pub use self::value::PgValue;
#[doc(hidden)]
#[cfg(feature = "with-deprecated")]
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
#[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")]
pub use crate::upsert;

Expand Down

0 comments on commit fb944fd

Please sign in to comment.