diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d2ce50..77e353d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - fix various module system bugs when combined with `@import` - expose more AST internals in `grass_compiler` + - allow building docs with stable/beta rust compiler # 0.12.4 diff --git a/crates/compiler/Cargo.toml b/crates/compiler/Cargo.toml index a598886..2aa29a7 100644 --- a/crates/compiler/Cargo.toml +++ b/crates/compiler/Cargo.toml @@ -16,6 +16,12 @@ path = "src/lib.rs" # crate-type = ["cdylib", "rlib"] bench = false +[package.metadata.docs.rs] +# To build locally: +# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open +all-features = true +rustdoc-args = ["--cfg", "doc_cfg"] + [dependencies] # todo: use lazy_static once_cell = "1.15.0" diff --git a/crates/compiler/src/ast/stmt.rs b/crates/compiler/src/ast/stmt.rs index ce7dd57..fe89554 100644 --- a/crates/compiler/src/ast/stmt.rs +++ b/crates/compiler/src/ast/stmt.rs @@ -522,6 +522,7 @@ pub enum AstSupportsCondition { #[derive(Debug, Clone)] pub struct AstSupportsRule { pub condition: AstSupportsCondition, + // todo: rename body pub children: Vec, pub span: Span, } diff --git a/crates/compiler/src/lib.rs b/crates/compiler/src/lib.rs index 6af7fab..b82df54 100644 --- a/crates/compiler/src/lib.rs +++ b/crates/compiler/src/lib.rs @@ -32,7 +32,7 @@ grass input.scss ``` */ -#![cfg_attr(doc, feature(doc_cfg))] +#![cfg_attr(doc_cfg, feature(doc_cfg))] #![warn(clippy::all, clippy::cargo, clippy::dbg_macro)] #![deny(missing_debug_implementations)] #![allow( diff --git a/crates/compiler/src/options.rs b/crates/compiler/src/options.rs index 71f9c79..b0528a6 100644 --- a/crates/compiler/src/options.rs +++ b/crates/compiler/src/options.rs @@ -160,9 +160,8 @@ impl<'a> Options<'a> { /// See the [`Builtin`] documentation for additional information #[must_use] #[inline] - #[cfg(feature = "custom-builtin-fns")] #[cfg(any(feature = "custom-builtin-fns", doc))] - #[cfg_attr(doc, doc(cfg(feature = "custom-builtin-fns")))] + #[cfg_attr(doc_cfg, doc(cfg(feature = "custom-builtin-fns")))] pub fn add_custom_fn>(mut self, name: S, func: Builtin) -> Self { self.custom_fns.insert(name.into(), func); self diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index beb843c..8719df2 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -23,6 +23,12 @@ path = "src/lib.rs" # crate-type = ["cdylib", "rlib"] bench = false +[package.metadata.docs.rs] +# To build locally: +# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open +all-features = true +rustdoc-args = ["--cfg", "doc_cfg"] + [dependencies] grass_compiler = { path = "../compiler", version = "0.12.4", default-features = false } include_sass = { path = "../include_sass", version = "0.12.4", optional = true } diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs index 2e3881d..39f403e 100644 --- a/crates/lib/src/lib.rs +++ b/crates/lib/src/lib.rs @@ -31,7 +31,7 @@ grass input.scss ``` */ -#![cfg_attr(doc, feature(doc_cfg))] +#![cfg_attr(doc_cfg, feature(doc_cfg))] #![warn(clippy::all, clippy::cargo, clippy::dbg_macro)] #![deny(missing_debug_implementations)] #![allow( @@ -107,7 +107,7 @@ pub use grass_compiler::{ /// for all options are used, except for output style, which is compressed. #[macro_export] #[cfg(any(feature = "macro", doc))] -#[cfg_attr(doc, doc(cfg(feature = "macro")))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "macro")))] macro_rules! include { ($path:literal) => { $crate::__internal::include_sass::include_sass!($path);