diff --git a/src/lib.rs b/src/lib.rs
index 52f21955..a80ab278 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -46,8 +46,6 @@
 )]
 #![allow(clippy::match_bool)]
 #![forbid(unsafe_code)]
-#![cfg_attr(feature = "nightly", feature(doc_cfg))]
-
 // we pass "--cfg docsrs" when building docs to add `This is supported on
 // feature="..." only.`
 //
@@ -55,6 +53,7 @@
 // ```console
 // $ RUSTDOCFLAGS="--cfg docsrs -Znormalize-docs" cargo +nightly doc --open --all-features
 // ```
+#![cfg_attr(feature = "nightly", feature(doc_cfg))]
 
 pub use dispatching::repls::{
     commands_repl, commands_repl_with_listener, dialogues_repl, dialogues_repl_with_listener, repl,