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

Enabled x509 and ssl features for doc.rs #353

Merged
merged 1 commit into from
Feb 21, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions mbedtls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ repository = "https://github.com/fortanix/rust-mbedtls"
documentation = "https://docs.rs/mbedtls/"
keywords = ["MbedTLS", "mbed", "TLS", "SSL", "cryptography"]

[package.metadata.docs.rs]
features = ["x509", "ssl"]

[dependencies]
bitflags = "1"
serde = { version = "1.0.7", default-features = false, features = ["alloc"] }
Expand Down Expand Up @@ -61,6 +64,7 @@ criterion = { version = "0.5.1", features = ["html_reports"] }

[build-dependencies]
cc = "1.0"
rustc_version = "0.4.0"

# feature 'time` is necessary under windows
[target.'cfg(target_env = "msvc")'.dependencies]
Expand Down
7 changes: 7 additions & 0 deletions mbedtls/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use std::collections::{HashMap, HashSet};
use std::env;

use rustc_version::Channel;

/// Return the crate hash that Cargo will be passing to `rustc -C metadata=`.
// If there's a panic in this code block, that means Cargo's way of running the
// build script has changed, and this code should be updated to handle the new
Expand All @@ -23,6 +25,11 @@ fn get_compilation_metadata_hash() -> String {
}

fn main() {
// used for configuring rustdoc attrs for now
if rustc_version::version_meta().is_ok_and(|v| v.channel == Channel::Nightly) {
println!("cargo:rustc-cfg=nightly");
}

let metadata_hash = get_compilation_metadata_hash();
println!("cargo:rustc-env=RUST_MBEDTLS_METADATA_HASH={}", metadata_hash);

Expand Down
1 change: 1 addition & 0 deletions mbedtls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#![deny(warnings)]
#![allow(unused_doc_comments)]
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(nightly, feature(doc_auto_cfg))]

#[cfg(not(any(feature = "std", feature = "no_std_deps")))]
compile_error!("Either the `std` or `no_std_deps` feature needs to be enabled");
Expand Down
Loading