-
Notifications
You must be signed in to change notification settings - Fork 696
Fix/6098 #6102
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
Fix/6098 #6102
Conversation
This reverts commit c24ec72.
I think it'd be better to do something more targeted to the feature activation, like the following patchset: diff --git a/clarity/src/vm/analysis/mod.rs b/clarity/src/vm/analysis/mod.rs
index 11e42ad9ae..2be1dcdf50 100644
--- a/clarity/src/vm/analysis/mod.rs
+++ b/clarity/src/vm/analysis/mod.rs
@@ -34,13 +34,16 @@ use self::trait_checker::TraitChecker;
use self::type_checker::v2_05::TypeChecker as TypeChecker2_05;
use self::type_checker::v2_1::TypeChecker as TypeChecker2_1;
pub use self::types::{AnalysisPass, ContractAnalysis};
+#[cfg(feature = "rusqlite")]
use crate::vm::ast::{build_ast_with_rules, ASTRules};
use crate::vm::costs::LimitedCostTracker;
#[cfg(feature = "rusqlite")]
use crate::vm::database::MemoryBackingStore;
use crate::vm::database::STORE_CONTRACT_SRC_INTERFACE;
use crate::vm::representations::SymbolicExpression;
-use crate::vm::types::{QualifiedContractIdentifier, TypeSignature};
+#[cfg(feature = "rusqlite")]
+use crate::vm::types::TypeSignature;
+use crate::vm::types::QualifiedContractIdentifier;
use crate::vm::ClarityVersion;
/// Used by CLI tools like the docs generator. Not used in production
diff --git a/clarity/src/vm/docs/contracts.rs b/clarity/src/vm/docs/contracts.rs
index 1acdda78d8..48684c0ca0 100644
--- a/clarity/src/vm/docs/contracts.rs
+++ b/clarity/src/vm/docs/contracts.rs
@@ -4,13 +4,11 @@ use hashbrown::{HashMap, HashSet};
use stacks_common::consts::CHAIN_ID_TESTNET;
use stacks_common::types::StacksEpochId;
-#[cfg(feature = "rusqlite")]
use crate::vm::analysis::mem_type_check;
use crate::vm::analysis::ContractAnalysis;
use crate::vm::ast::{build_ast_with_rules, ASTRules};
use crate::vm::contexts::GlobalContext;
use crate::vm::costs::LimitedCostTracker;
-#[cfg(feature = "rusqlite")]
use crate::vm::database::MemoryBackingStore;
use crate::vm::docs::{get_input_type_string, get_output_type_string, get_signature};
use crate::vm::types::{FunctionType, QualifiedContractIdentifier, Value};
@@ -63,7 +61,6 @@ fn make_func_ref(func_name: &str, func_type: &FunctionType, description: &str) -
}
}
-#[cfg(feature = "rusqlite")]
#[allow(clippy::expect_used)]
fn get_constant_value(var_name: &str, contract_content: &str) -> Value {
let to_eval = format!("{}\n{}", contract_content, var_name);
@@ -72,7 +69,6 @@ fn get_constant_value(var_name: &str, contract_content: &str) -> Value {
.expect("BUG: failed to return constant value")
}
-#[cfg(feature = "rusqlite")]
fn doc_execute(program: &str) -> Result<Option<Value>, vm::Error> {
let contract_id = QualifiedContractIdentifier::transient();
let mut contract_context = ContractContext::new(contract_id.clone(), ClarityVersion::Clarity2);
@@ -99,7 +95,6 @@ fn doc_execute(program: &str) -> Result<Option<Value>, vm::Error> {
})
}
-#[cfg(feature = "rusqlite")]
#[allow(clippy::expect_used)]
pub fn make_docs(
content: &str,
@@ -185,7 +180,6 @@ pub fn make_docs(
/// Produce a set of documents for multiple contracts, supplied as a list of `(contract_name, contract_content)` pairs,
/// and a map from `contract_name` to corresponding `ContractSupportDocs`
-#[cfg(feature = "rusqlite")]
pub fn produce_docs_refs<A: AsRef<str>, B: AsRef<str>>(
contracts: &[(A, B)],
support_docs: &HashMap<&str, ContractSupportDocs>,
diff --git a/clarity/src/vm/docs/mod.rs b/clarity/src/vm/docs/mod.rs
index d47057b29c..54e1247f9b 100644
--- a/clarity/src/vm/docs/mod.rs
+++ b/clarity/src/vm/docs/mod.rs
@@ -23,6 +23,7 @@ use crate::vm::types::{FixedFunction, FunctionType};
use crate::vm::variables::NativeVariables;
use crate::vm::ClarityVersion;
+#[cfg(feature = "rusqlite")]
pub mod contracts;
#[derive(Serialize)] |
this was definitely a solution i was looking into (the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6102 +/- ##
===========================================
- Coverage 83.71% 83.54% -0.17%
===========================================
Files 538 538
Lines 388438 388534 +96
Branches 323 323
===========================================
- Hits 325172 324593 -579
- Misses 63258 63933 +675
Partials 8 8
... and 65 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Adds
#[allow(unused_imports)]
to unused import warnings during cargo check.This PR is to check something unrelated, so it may be closed if this "fix" is deemed insufficient to resolve #6098