Skip to content

Commit

Permalink
Enabled x509 and ssl features for doc.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Arash Sahebolamri committed Feb 16, 2024
1 parent 55eac05 commit c09eb6f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
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

0 comments on commit c09eb6f

Please sign in to comment.