Skip to content

Commit

Permalink
Make HTTP/3 feature more unstable (#1780)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Mar 17, 2023
1 parent 57a8a01 commit 4db868b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -17,6 +17,7 @@ jobs:
needs:
- style
- test
- unstable
- nightly
- msrv
- android
Expand Down Expand Up @@ -182,6 +183,22 @@ jobs:
- name: Test
run: cargo test ${{ matrix.features }} ${{ matrix.test-features }} -- --test-threads=1

unstable:
name: "unstable features"
needs: [style]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 'stable'

- name: Check
run: RUSTFLAGS="--cfg reqwest_unstable" cargo check --features http3

docs:
name: Docs
runs-on: ubuntu-latest
Expand All @@ -195,7 +212,7 @@ jobs:

- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
RUSTDOCFLAGS: --cfg reqwest_unstable -D warnings
run: cargo doc --no-deps --document-private-items --all-features

# Separate build job for nightly because of the missing feature for allowed failures at
Expand All @@ -222,6 +239,8 @@ jobs:
# run: cargo test --features __internal_proxy_sys_no_cache -- --test-threads=1

- name: Check minimal versions
env:
RUSTFLAGS: --cfg reqwest_unstable
run: |
cargo clean
cargo update -Z minimal-versions
Expand Down
24 changes: 24 additions & 0 deletions src/lib.rs
Expand Up @@ -191,6 +191,22 @@
//! - **trust-dns**: Enables a trust-dns async resolver instead of default
//! threadpool using `getaddrinfo`.
//!
//! ## Unstable Features
//!
//! Some feature flags require additional opt-in by the application, by setting
//! a `reqwest_unstable` flag.
//!
//! - **http3** *(unstable)*: Enables support for sending HTTP/3 requests.
//!
//! These features are unstable, and experimental. Details about them may be
//! changed in patch releases.
//!
//! You can pass such a flag to the compiler via `.cargo/config`, or
//! environment variables, such as:
//!
//! ```notrust
//! RUSTFLAGS="--cfg reqwest_unstable" cargo build
//! ```
//!
//! [hyper]: http://hyper.rs
//! [blocking]: ./blocking/index.html
Expand All @@ -203,6 +219,14 @@
//! [Proxy]: ./struct.Proxy.html
//! [cargo-features]: https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-features-section

#[cfg(all(feature = "http3", not(reqwest_unstable)))]
compile_error!(
"\
The `http3` feature is unstable, and requires the \
`RUSTFLAGS='--cfg reqwest_unstable'` environment variable to be set.\
"
);

macro_rules! if_wasm {
($($item:item)*) => {$(
#[cfg(target_arch = "wasm32")]
Expand Down

0 comments on commit 4db868b

Please sign in to comment.