Skip to content

Commit 64faade

Browse files
authored
Merge pull request diesel-rs#1982 from diesel-rs/sg-remove-deprecated
Remove all deprecated code
2 parents 55f5b93 + a34d93a commit 64faade

26 files changed

Lines changed: 17 additions & 530 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ for Rust libraries in [RFC #1105](https://github.com/rust-lang/rfcs/blob/master/
66

77
## Unreleased
88

9+
### Removed
10+
11+
* All previously deprecated items have been removed.
12+
913
### Changed
1014

1115
* The way [the `Backend` trait][backend-2-0-0] handles its `RawValue` type has

bin/test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ else
2020
(cd diesel && cargo test --no-default-features --features "extras sqlite postgres mysql" $*)
2121

2222
(cd diesel_cli && cargo test --features "sqlite" --no-default-features $*)
23-
(cd diesel_migrations && cargo test --features "sqlite" $*)
23+
(cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" $*)
2424
(cd diesel_derives && cargo test --features "diesel/sqlite" $*)
2525
(cd diesel_tests && cargo test --features "sqlite" --no-default-features $*)
2626

27-
(cd diesel_migrations && cargo test --features "postgres" $*)
27+
(cd diesel_migrations && cargo test --features "postgres diesel/postgres" $*)
2828
(cd diesel_derives && cargo test --features "diesel/postgres" $*)
2929
(cd diesel_cli && cargo test --features "postgres" --no-default-features $*)
3030
(cd diesel_tests && cargo test --features "postgres" --no-default-features $*)
3131

3232
export RUST_TEST_THREADS=1
33-
(cd diesel_migrations && cargo test --features "mysql" $*)
33+
(cd diesel_migrations && cargo test --features "mysql diesel/mysql" $*)
3434
(cd diesel_derives && cargo test --features "diesel/mysql" $*)
3535
(cd diesel_cli && cargo test --features "mysql" --no-default-features $*)
3636
(cd diesel_tests && cargo test --features "mysql" --no-default-features $*)

diesel/src/backend.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,3 @@ pub trait SupportsReturningClause {}
7070
pub trait SupportsDefaultKeyword {}
7171
/// Does this backend use the standard `SAVEPOINT` syntax?
7272
pub trait UsesAnsiSavepointSyntax {}
73-
74-
#[cfg(feature = "with-deprecated")]
75-
#[deprecated(since = "1.1.0", note = "use `sql_types::TypeMetadata` instead")]
76-
pub use sql_types::TypeMetadata;

diesel/src/expression/functions/helper_types.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ use sql_types::Bool;
88
/// The return type of [`not(expr)`](../dsl/fn.not.html)
99
pub type not<Expr> = operators::Not<Grouped<AsExprOf<Expr, Bool>>>;
1010

11-
/// The return type of `not(expr)`
12-
#[deprecated(since = "1.1.0", note = "use `not` instead")]
13-
#[cfg(feature = "with-deprecated")]
14-
pub type Not<Expr> = not<Expr>;
15-
1611
/// The return type of [`max(expr)`](../dsl/fn.max.html)
1712
pub type max<Expr> = super::aggregate_ordering::max::HelperType<SqlTypeOf<Expr>, Expr>;
1813

diesel/src/expression/functions/mod.rs

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,3 @@
1-
#[macro_export]
2-
#[doc(hidden)]
3-
#[cfg(feature = "with-deprecated")]
4-
#[deprecated(
5-
since = "1.3.0",
6-
note = "The syntax of `sql_function!` and its output have changed significantly. This form has been deprecated. See the documentation of `sql_function!` for details on the new syntax."
7-
)]
8-
macro_rules! sql_function_body {
9-
(
10-
$fn_name:ident,
11-
$struct_name:ident,
12-
($($arg_name:ident: $arg_type:ty),*) -> $return_type:ty,
13-
$docs:expr,
14-
$helper_ty_docs:expr
15-
) => {
16-
#[allow(non_camel_case_types)]
17-
#[derive(Debug, Clone, Copy, QueryId)]
18-
#[doc(hidden)]
19-
pub struct $struct_name<$($arg_name),*> {
20-
$($arg_name: $arg_name),*
21-
}
22-
23-
#[allow(non_camel_case_types)]
24-
#[doc=$helper_ty_docs]
25-
pub type $fn_name<$($arg_name),*> = $struct_name<$(
26-
<$arg_name as $crate::expression::AsExpression<$arg_type>>::Expression
27-
),*>;
28-
29-
#[allow(non_camel_case_types)]
30-
#[doc=$docs]
31-
pub fn $fn_name<$($arg_name),*>($($arg_name: $arg_name),*)
32-
-> $fn_name<$($arg_name),*>
33-
where $($arg_name: $crate::expression::AsExpression<$arg_type>),+
34-
{
35-
$struct_name {
36-
$($arg_name: $arg_name.as_expression()),+
37-
}
38-
}
39-
40-
#[allow(non_camel_case_types)]
41-
impl<$($arg_name),*> $crate::expression::Expression for $struct_name<$($arg_name),*> where
42-
for <'a> ($(&'a $arg_name),*): $crate::expression::Expression,
43-
{
44-
type SqlType = $return_type;
45-
}
46-
47-
#[allow(non_camel_case_types)]
48-
impl<$($arg_name),*, DB> $crate::query_builder::QueryFragment<DB> for $struct_name<$($arg_name),*> where
49-
DB: $crate::backend::Backend,
50-
for <'a> ($(&'a $arg_name),*): $crate::query_builder::QueryFragment<DB>,
51-
{
52-
fn walk_ast(&self, mut out: $crate::query_builder::AstPass<DB>) -> $crate::result::QueryResult<()> {
53-
out.push_sql(concat!(stringify!($fn_name), "("));
54-
$crate::query_builder::QueryFragment::walk_ast(
55-
&($(&self.$arg_name),*), out.reborrow())?;
56-
out.push_sql(")");
57-
Ok(())
58-
}
59-
}
60-
61-
#[allow(non_camel_case_types)]
62-
impl<$($arg_name),*, QS> $crate::expression::SelectableExpression<QS> for $struct_name<$($arg_name),*> where
63-
$($arg_name: $crate::expression::SelectableExpression<QS>,)*
64-
$struct_name<$($arg_name),*>: $crate::expression::AppearsOnTable<QS>,
65-
{
66-
}
67-
68-
#[allow(non_camel_case_types)]
69-
impl<$($arg_name),*, QS> $crate::expression::AppearsOnTable<QS> for $struct_name<$($arg_name),*> where
70-
$($arg_name: $crate::expression::AppearsOnTable<QS>,)*
71-
$struct_name<$($arg_name),*>: $crate::expression::Expression,
72-
{
73-
}
74-
75-
#[allow(non_camel_case_types)]
76-
impl<$($arg_name),*> $crate::expression::NonAggregate for $struct_name<$($arg_name),*> where
77-
$($arg_name: $crate::expression::NonAggregate,)*
78-
$struct_name<$($arg_name),*>: $crate::expression::Expression,
79-
{
80-
}
81-
}
82-
}
83-
84-
#[macro_export]
85-
#[doc(hidden)]
86-
#[cfg(not(feature = "with-deprecated"))]
87-
macro_rules! sql_function_body {
88-
($($args:tt)*) => {
89-
compile_error!(
90-
"You are using a deprecated form of `sql_function!`. \
91-
You must enable the `with-deprecated` feature on `diesel`."
92-
);
93-
};
94-
}
95-
961
#[macro_export]
972
#[doc(hidden)]
983
macro_rules! __diesel_sql_function_body {

diesel/src/expression_methods/global_expression_methods.rs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -76,37 +76,6 @@ pub trait ExpressionMethods: Expression + Sized {
7676
In::new(self, values.as_in_expression())
7777
}
7878

79-
/// Deprecated alias for `ne_all`
80-
///
81-
/// ```rust
82-
/// # #[macro_use] extern crate diesel;
83-
/// # include!("../doctest_setup.rs");
84-
/// #
85-
/// # fn main() {
86-
/// # use schema::users::dsl::*;
87-
/// # let connection = establish_connection();
88-
/// # connection.execute("INSERT INTO users (name) VALUES
89-
/// # ('Jim')").unwrap();
90-
/// let data = users.select(id).filter(name.ne_any(vec!["Sean", "Jim"]));
91-
/// assert_eq!(Ok(vec![2]), data.load(&connection));
92-
///
93-
/// let data = users.select(id).filter(name.ne_any(vec!["Tess"]));
94-
/// assert_eq!(Ok(vec![1, 3]), data.load(&connection));
95-
///
96-
/// // Calling `ne_any` with an empty array is the same as doing `WHERE 1=1`
97-
/// let data = users.select(id).filter(name.ne_any(Vec::<String>::new()));
98-
/// assert_eq!(Ok(vec![1, 2, 3]), data.load(&connection));
99-
/// # }
100-
/// ```
101-
#[cfg(feature = "with-deprecated")]
102-
#[deprecated(since = "1.2.0", note = "use `ne_all` instead")]
103-
fn ne_any<T>(self, values: T) -> NotIn<Self, T::InExpression>
104-
where
105-
T: AsInExpression<Self::SqlType>,
106-
{
107-
NotIn::new(self, values.as_in_expression())
108-
}
109-
11079
/// Creates a SQL `NOT IN` statement.
11180
///
11281
/// Queries using this method will not be

diesel/src/lib.rs

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -93,41 +93,6 @@
9393
//! You can come ask for help at
9494
//! [gitter.im/diesel-rs/diesel](https://gitter.im/diesel-rs/diesel)
9595
96-
#![cfg_attr(
97-
feature = "large-tables",
98-
deprecated(
99-
since = "1.2.0",
100-
note = "The large-tables feature has been renamed to 32-column-tables"
101-
)
102-
)]
103-
#![cfg_attr(
104-
feature = "huge-tables",
105-
deprecated(
106-
since = "1.2.0",
107-
note = "The huge-tables feature has been renamed to 64-column-tables"
108-
)
109-
)]
110-
#![cfg_attr(
111-
feature = "x32-column-tables",
112-
deprecated(
113-
since = "1.2.1",
114-
note = "The x32-column-tables feature has been reanmed to 32-column-tables. The x was a workaround for a bug in crates.io that has since been resolved"
115-
)
116-
)]
117-
#![cfg_attr(
118-
feature = "x64-column-tables",
119-
deprecated(
120-
since = "1.2.1",
121-
note = "The x64-column-tables feature has been reanmed to 64-column-tables. The x was a workaround for a bug in crates.io that has since been resolved"
122-
)
123-
)]
124-
#![cfg_attr(
125-
feature = "x128-column-tables",
126-
deprecated(
127-
since = "1.2.1",
128-
note = "The x128-column-tables feature has been reanmed to 128-column-tables. The x was a workaround for a bug in crates.io that has since been resolved"
129-
)
130-
)]
13196
#![cfg_attr(feature = "unstable", feature(specialization, try_from))]
13297
// Built-in Lints
13398
#![deny(
@@ -200,7 +165,6 @@ pub mod serialize;
200165
pub mod sql_types;
201166
pub mod migration;
202167
pub mod row;
203-
pub mod types;
204168

205169
#[cfg(feature = "mysql")]
206170
pub mod mysql;
@@ -257,12 +221,6 @@ pub mod helper_types {
257221
pub type FindBy<Source, Column, Value> = Filter<Source, Eq<Column, Value>>;
258222

259223
/// Represents the return type of `.for_update()`
260-
#[cfg(feature = "with-deprecated")]
261-
#[allow(deprecated)]
262-
pub type ForUpdate<Source> = <Source as ForUpdateDsl>::Output;
263-
264-
/// Represents the return type of `.for_update()`
265-
#[cfg(not(feature = "with-deprecated"))]
266224
pub type ForUpdate<Source> = <Source as LockingDsl<lock::ForUpdate>>::Output;
267225

268226
/// Represents the return type of `.for_no_key_update()`

diesel/src/macros/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,8 +1058,6 @@ macro_rules! not_none {
10581058
#[macro_use]
10591059
mod internal;
10601060
#[macro_use]
1061-
mod query_id;
1062-
#[macro_use]
10631061
mod static_cond;
10641062
#[macro_use]
10651063
mod ops;

diesel/src/macros/query_id.rs

Lines changed: 0 additions & 72 deletions
This file was deleted.

diesel/src/pg/backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use byteorder::NetworkEndian;
55
use super::query_builder::PgQueryBuilder;
66
use super::PgMetadataLookup;
77
use backend::*;
8-
use prelude::Queryable;
8+
use deserialize::Queryable;
99
use query_builder::bind_collector::RawBytesBindCollector;
1010
use sql_types::{Oid, TypeMetadata};
1111

0 commit comments

Comments
 (0)