Skip to content

Commit 80fef9a

Browse files
committed
Use a raw cfg flag for the unstable doc_cfg feature
1 parent ef8df44 commit 80fef9a

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ jobs:
4747
shell: bash
4848
if: matrix.rust == 'nightly'
4949
run: |
50-
echo "RUSTFLAGS=--cap-lints=warn" >> $GITHUB_ENV
50+
echo "RUSTFLAGS=--cap-lints=warn --cfg doc_cfg" >> $GITHUB_ENV
51+
echo "RUSTDOCFLAGS=--cfg doc_cfg" >> $GITHUB_ENV
5152
5253
- name: Install postgres (Linux)
5354
if: runner.os == 'Linux' && matrix.backend == 'postgres'
@@ -299,7 +300,7 @@ jobs:
299300
uses: actions-rs/cargo@v1
300301
with:
301302
command: doc
302-
args: --manifest-path diesel/Cargo.toml --no-deps --no-default-features --features "${{ matrix.backend }} unstable doc_cfg i-implement-a-third-party-backend-and-opt-into-breaking-changes"
303+
args: --manifest-path diesel/Cargo.toml --no-deps --no-default-features --features "${{ matrix.backend }} unstable i-implement-a-third-party-backend-and-opt-into-breaking-changes"
303304

304305
- name: Run rustdoc
305306
if: matrix.run != 'nightly'

.github/workflows/doc.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ jobs:
3737
sudo apt-get update
3838
sudo apt-get -y install libmysqlclient-dev libsqlite3-dev libpq-dev
3939
- name: Build documentation
40+
env:
41+
RUSTFLAGS: "--cfg doc_cfg"
42+
RUSTDOCFLAGS: "--cfg doc_cfg"
4043
run:
41-
cargo +nightly doc --manifest-path diesel/Cargo.toml --features "postgres sqlite mysql extras i-implement-a-third-party-backend-and-opt-into-breaking-changes doc_cfg" --workspace
44+
cargo +nightly doc --manifest-path diesel/Cargo.toml --features "postgres sqlite mysql extras i-implement-a-third-party-backend-and-opt-into-breaking-changes" --workspace
4245

4346
- name: Publish documentation
4447
if: success()

diesel/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ doc_cfg = []
6868
[package.metadata.docs.rs]
6969
features = ["postgres", "mysql", "sqlite", "extras"]
7070
no-default-features = true
71+
rustc-args = ["--cfg", "doc_cfg"]
72+
rustdoc-args = ["--cfg", "doc_cfg"]

diesel/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
//! - `32-column-tables`
159159
160160
#![cfg_attr(feature = "unstable", feature(trait_alias))]
161-
#![cfg_attr(feature = "doc_cfg", feature(doc_cfg, doc_auto_cfg))]
161+
#![cfg_attr(doc_cfg, feature(doc_cfg, doc_auto_cfg))]
162162
#![cfg_attr(feature = "128-column-tables", recursion_limit = "256")]
163163
// Built-in Lints
164164
#![deny(warnings)]

0 commit comments

Comments
 (0)