From 2effb5497a687e7f4cd7abbd3c5726eb28d4c06c Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Wed, 7 Aug 2024 09:54:58 -0400 Subject: [PATCH] webpki-roots: use explicit lifetimes --- webpki-roots/src/lib.rs | 3 ++- webpki-roots/tests/codegen.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webpki-roots/src/lib.rs b/webpki-roots/src/lib.rs index a2913c9..1eb6710 100644 --- a/webpki-roots/src/lib.rs +++ b/webpki-roots/src/lib.rs @@ -25,6 +25,7 @@ #![no_std] #![forbid(unsafe_code, unstable_features)] #![deny( + elided_lifetimes_in_paths, trivial_casts, trivial_numeric_casts, unused_import_braces, @@ -34,7 +35,7 @@ use pki_types::{Der, TrustAnchor}; -pub const TLS_SERVER_ROOTS: &[TrustAnchor] = &[ +pub const TLS_SERVER_ROOTS: &[TrustAnchor<'static>] = &[ /* * Issuer: CN=DigiCert TLS ECC P384 Root G5 O=DigiCert, Inc. * Subject: CN=DigiCert TLS ECC P384 Root G5 O=DigiCert, Inc. diff --git a/webpki-roots/tests/codegen.rs b/webpki-roots/tests/codegen.rs index e0ff3f3..70fff28 100644 --- a/webpki-roots/tests/codegen.rs +++ b/webpki-roots/tests/codegen.rs @@ -14,7 +14,7 @@ async fn new_generated_code_is_fresh() { let tls_roots_map = fetch_ccadb_roots().await; let mut code = String::with_capacity(256 * 1_024); code.push_str(HEADER); - code.push_str("pub const TLS_SERVER_ROOTS: &[TrustAnchor] = &[\n"); + code.push_str("pub const TLS_SERVER_ROOTS: &[TrustAnchor<'static>] = &[\n"); let (mut subject, mut spki, mut name_constraints) = (String::new(), String::new(), String::new()); @@ -162,6 +162,7 @@ const HEADER: &str = r#"//! A compiled-in copy of the root certificates trusted #![no_std] #![forbid(unsafe_code, unstable_features)] #![deny( + elided_lifetimes_in_paths, trivial_casts, trivial_numeric_casts, unused_import_braces,