Skip to content

Commit 95f92ff

Browse files
committed
Fix CI errors
1 parent dc1965b commit 95f92ff

1 file changed

Lines changed: 22 additions & 62 deletions

File tree

diesel/src/backend.rs

Lines changed: 22 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,13 @@ pub trait SqlDialect: self::private::TrustedBackend {
290290
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
291291
)]
292292
pub(crate) mod sql_dialect {
293+
#![cfg_attr(
294+
not(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"),
295+
// Otherwise there are false positives
296+
// because the lint seems to believe that these pub statements
297+
// are not required, but they are required through the various backend impls
298+
allow(unreachable_pub)
299+
)]
293300
#[cfg(doc)]
294301
use super::SqlDialect;
295302

@@ -304,18 +311,11 @@ pub(crate) mod sql_dialect {
304311
/// If you use a custom type to specify specialized support for `ON CONFLICT` clauses
305312
/// implementing this trait opts into reusing diesels existing `ON CONFLICT`
306313
/// `QueryFragment` implementations
307-
#[diesel_derives::__diesel_public_if(
308-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
309-
)]
310-
311-
pub(crate) trait SupportsOnConflictClause {}
314+
pub trait SupportsOnConflictClause {}
312315

313316
/// This marker type indicates that `ON CONFLICT` clauses are not supported for this backend
314317
#[derive(Debug, Copy, Clone)]
315-
#[diesel_derives::__diesel_public_if(
316-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
317-
)]
318-
pub(crate) struct DoesNotSupportOnConflictClause;
318+
pub struct DoesNotSupportOnConflictClause;
319319
}
320320

321321
/// This module contains all reusable options to configure
@@ -328,25 +328,16 @@ pub(crate) mod sql_dialect {
328328
///
329329
/// If you use custom type to specify specialized support for `RETURNING` clauses
330330
/// implementing this trait opts in supporting `RETURNING` clause syntax
331-
#[diesel_derives::__diesel_public_if(
332-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
333-
)]
334-
pub(crate) trait SupportsReturningClause {}
331+
pub trait SupportsReturningClause {}
335332

336333
/// Indicates that a backend provides support for `RETURNING` clauses
337334
/// using the postgresql `RETURNING` syntax
338335
#[derive(Debug, Copy, Clone)]
339-
#[diesel_derives::__diesel_public_if(
340-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
341-
)]
342-
pub(crate) struct PgLikeReturningClause;
336+
pub struct PgLikeReturningClause;
343337

344338
/// Indicates that a backend does not support `RETURNING` clauses
345339
#[derive(Debug, Copy, Clone)]
346-
#[diesel_derives::__diesel_public_if(
347-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
348-
)]
349-
pub(crate) struct DoesNotSupportReturningClause;
340+
pub struct DoesNotSupportReturningClause;
350341

351342
impl SupportsReturningClause for PgLikeReturningClause {}
352343
}
@@ -365,26 +356,17 @@ pub(crate) mod sql_dialect {
365356
/// expressions implementing this trait opts in support for `DEFAULT`
366357
/// value expressions for inserts. Otherwise diesel will emulate this
367358
/// behaviour.
368-
#[diesel_derives::__diesel_public_if(
369-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
370-
)]
371-
pub(crate) trait SupportsDefaultKeyword {}
359+
pub trait SupportsDefaultKeyword {}
372360

373361
/// Indicates that a backend support `DEFAULT` value expressions
374362
/// for `INSERT INTO` statements based on the ISO SQL standard
375363
#[derive(Debug, Copy, Clone)]
376-
#[diesel_derives::__diesel_public_if(
377-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
378-
)]
379-
pub(crate) struct IsoSqlDefaultKeyword;
364+
pub struct IsoSqlDefaultKeyword;
380365

381366
/// Indicates that a backend does not support `DEFAULT` value
382367
/// expressions0for `INSERT INTO` statements
383368
#[derive(Debug, Copy, Clone)]
384-
#[diesel_derives::__diesel_public_if(
385-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
386-
)]
387-
pub(crate) struct DoesNotSupportDefaultKeyword;
369+
pub struct DoesNotSupportDefaultKeyword;
388370

389371
impl SupportsDefaultKeyword for IsoSqlDefaultKeyword {}
390372
}
@@ -397,30 +379,20 @@ pub(crate) mod sql_dialect {
397379
pub(crate) mod batch_insert_support {
398380
/// A marker trait indicating if batch insert statements
399381
/// are supported for this backend or not
400-
#[diesel_derives::__diesel_public_if(
401-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
402-
)]
403-
pub(crate) trait SupportsBatchInsert {}
382+
pub trait SupportsBatchInsert {}
404383

405384
/// Indicates that this backend does not support batch
406385
/// insert statements.
407386
/// In this case diesel will emulate batch insert support
408387
/// by inserting each row on it's own
409388
#[derive(Debug, Copy, Clone)]
410-
#[diesel_derives::__diesel_public_if(
411-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
412-
)]
413-
pub(crate) struct DoesNotSupportBatchInsert;
389+
pub struct DoesNotSupportBatchInsert;
414390

415391
/// Indicates that this backend supports postgres style
416392
/// batch insert statements to insert multiple rows using one
417393
/// insert statement
418394
#[derive(Debug, Copy, Clone)]
419-
#[diesel_derives::__diesel_public_if(
420-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
421-
)]
422-
423-
pub(crate) struct PostgresLikeBatchInsertSupport;
395+
pub struct PostgresLikeBatchInsertSupport;
424396

425397
impl SupportsBatchInsert for PostgresLikeBatchInsertSupport {}
426398
}
@@ -437,10 +409,7 @@ pub(crate) mod sql_dialect {
437409
/// that a row consisting only of default
438410
/// values should be inserted
439411
#[derive(Debug, Clone, Copy)]
440-
#[diesel_derives::__diesel_public_if(
441-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
442-
)]
443-
pub(crate) struct AnsiDefaultValueClause;
412+
pub struct AnsiDefaultValueClause;
444413
}
445414

446415
/// This module contains all reusable options to configure
@@ -454,10 +423,7 @@ pub(crate) mod sql_dialect {
454423
/// the `FROM` clause in `SELECT` statements
455424
/// if no table/view is queried
456425
#[derive(Debug, Copy, Clone)]
457-
#[diesel_derives::__diesel_public_if(
458-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
459-
)]
460-
pub(crate) struct AnsiSqlFromClauseSyntax;
426+
pub struct AnsiSqlFromClauseSyntax;
461427
}
462428

463429
/// This module contains all reusable options to configure
@@ -471,10 +437,7 @@ pub(crate) mod sql_dialect {
471437
/// treats `EXIST()` as function
472438
/// like expression
473439
#[derive(Debug, Copy, Clone)]
474-
#[diesel_derives::__diesel_public_if(
475-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
476-
)]
477-
pub(crate) struct AnsiSqlExistsSyntax;
440+
pub struct AnsiSqlExistsSyntax;
478441
}
479442

480443
/// This module contains all reusable options to configure
@@ -487,10 +450,7 @@ pub(crate) mod sql_dialect {
487450
/// Indicates that this backend requires a single bind
488451
/// per array element in `IN()` and `NOT IN()` expression
489452
#[derive(Debug, Copy, Clone)]
490-
#[diesel_derives::__diesel_public_if(
491-
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
492-
)]
493-
pub(crate) struct AnsiSqlArrayComparison;
453+
pub struct AnsiSqlArrayComparison;
494454
}
495455
}
496456

0 commit comments

Comments
 (0)