diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 875ea1d7210..3a9dc28b3c0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,7 +24,7 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Run clippy - run: cargo clippy --workspace --tests -- -D warnings + run: cargo clippy --workspace --tests -- -D warnings --cfg ignore_serenity_deprecated rustfmt: name: Format diff --git a/examples/e05_command_framework/src/main.rs b/examples/e05_command_framework/src/main.rs index 37b8160fe5b..28deeb4bc55 100644 --- a/examples/e05_command_framework/src/main.rs +++ b/examples/e05_command_framework/src/main.rs @@ -7,6 +7,7 @@ //! git = "https://github.com/serenity-rs/serenity.git" //! features = ["framework", "standard_framework"] //! ``` +#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework. use std::collections::{HashMap, HashSet}; use std::env; use std::fmt::Write; diff --git a/examples/e06_sample_bot_structure/src/main.rs b/examples/e06_sample_bot_structure/src/main.rs index fd022583ef4..5ebcc63f47d 100644 --- a/examples/e06_sample_bot_structure/src/main.rs +++ b/examples/e06_sample_bot_structure/src/main.rs @@ -7,6 +7,7 @@ //! git = "https://github.com/serenity-rs/serenity.git" //! features = ["framework", "standard_framework"] //! ``` +#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework. mod commands; use std::collections::HashSet; diff --git a/examples/e07_env_logging/src/main.rs b/examples/e07_env_logging/src/main.rs index aac642b6870..f49348526c8 100644 --- a/examples/e07_env_logging/src/main.rs +++ b/examples/e07_env_logging/src/main.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework. + use std::env; use serenity::async_trait; diff --git a/examples/e10_collectors/src/main.rs b/examples/e10_collectors/src/main.rs index 424dc8d8d5e..c6f25852411 100644 --- a/examples/e10_collectors/src/main.rs +++ b/examples/e10_collectors/src/main.rs @@ -1,5 +1,6 @@ //! This example will showcase the beauty of collectors. They allow to await messages or reactions //! from a user in the middle of a control flow, one being a command. +#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework. use std::collections::HashSet; use std::env; use std::time::Duration; diff --git a/examples/e12_global_data/src/main.rs b/examples/e12_global_data/src/main.rs index 97d74f69965..e19e3efd2b6 100644 --- a/examples/e12_global_data/src/main.rs +++ b/examples/e12_global_data/src/main.rs @@ -1,5 +1,6 @@ //! In this example, you will be shown various ways of sharing data between events and commands. //! And how to use locks correctly to avoid deadlocking the bot. +#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework. use std::collections::HashMap; use std::env; diff --git a/examples/e15_simple_dashboard/src/main.rs b/examples/e15_simple_dashboard/src/main.rs index 54c676b7d4f..278965cb21e 100644 --- a/examples/e15_simple_dashboard/src/main.rs +++ b/examples/e15_simple_dashboard/src/main.rs @@ -5,6 +5,7 @@ //! Example 7 is needed because tracing is being used. //! Example 12 is needed because global data and atomic are used. //! Example 13 is needed for the parallel loops that are running to update data from the dashboard. +#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework. // be lazy, import all macros globally! #[macro_use] diff --git a/src/framework/mod.rs b/src/framework/mod.rs index 4580ea292cb..1ca3ae398a2 100644 --- a/src/framework/mod.rs +++ b/src/framework/mod.rs @@ -85,6 +85,7 @@ pub mod standard; use async_trait::async_trait; #[cfg(feature = "standard_framework")] +#[allow(deprecated)] pub use self::standard::StandardFramework; use crate::client::{Client, Context, FullEvent}; diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index 8421be1507c..0df11f83b55 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -1,3 +1,8 @@ +#![cfg_attr( + not(ignore_serenity_deprecated), + deprecated = "The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling" +)] + pub mod help_commands; pub mod macros { pub use command_attr::{check, command, group, help, hook};