Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make HTTP/3 feature more unstable #1780

Merged
merged 1 commit into from Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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