Avoid overriding $RUSTFLAGS when needed for rustc 1.63
[dnssec-prover] / src / http.rs
index ab162c94e68f2e5d65c9adfcbcd7f3cfb723250f..00383b679b91dafd26c0545a29b999a26c0d6531 100644 (file)
@@ -4,11 +4,24 @@
 
 // const_slice_from_raw_parts was stabilized in 1.64, however we support building on 1.63 as well.
 // Luckily, it seems to work fine in 1.63 with the feature flag (and RUSTC_BOOTSTRAP=1) enabled.
-#![cfg_attr(feature = "validation", allow(stable_features))]
-#![cfg_attr(feature = "validation", feature(const_slice_from_raw_parts))]
+#![cfg_attr(all(feature = "validation", rust_1_63), feature(const_slice_from_raw_parts))]
+
+#![allow(clippy::new_without_default)] // why is this even a lint
+#![allow(clippy::result_unit_err)] // Why in the hell is this a lint?
+#![allow(clippy::get_first)] // Sometimes this improves readability
+#![allow(clippy::needless_lifetimes)] // lifetimes improve readability
+#![allow(clippy::needless_borrow)] // borrows indicate read-only/non-move
+#![allow(clippy::too_many_arguments)] // sometimes we don't have an option
+#![allow(clippy::identity_op)] // sometimes identities improve readability for repeated actions
+#![allow(clippy::erasing_op)] // sometimes identities improve readability for repeated actions
 
 extern crate alloc;
 
+/// The maximum number of requests we will make when building a proof or the maximum number of
+/// [`rr::RRSig`] sets we'll validate records from when validating proofs.
+// Note that this is duplicated exactly in src/lib.rs
+pub const MAX_PROOF_STEPS: usize = 20;
+
 pub mod rr;
 pub mod ser;
 pub mod query;
@@ -37,6 +50,9 @@ async fn main() {
        imp::run_server(listener, resolver_sockaddr).await;
 }
 
+#[cfg(not(feature = "build_server"))]
+fn main() { panic!("You need to enable the `build_server` feature to use the built-in server"); }
+
 #[cfg(any(feature = "build_server", all(feature = "tokio", feature = "validation")))]
 mod imp {
        use super::*;