forked from kent/consciousness
Gate nightly diagnostics behind feature
This commit is contained in:
parent
25e4775974
commit
156b6863f4
5 changed files with 13 additions and 8 deletions
|
|
@ -18,6 +18,9 @@ name = "consciousness"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|
||||||
|
[features]
|
||||||
|
nightly-diagnostics = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
html2md = "0.2"
|
html2md = "0.2"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(panic_backtrace_config)]
|
#![cfg_attr(feature = "nightly-diagnostics", feature(panic_backtrace_config))]
|
||||||
#![warn(unreachable_pub)]
|
#![warn(unreachable_pub)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
@ -13,6 +13,8 @@ fn main() {
|
||||||
if std::env::var_os("RUST_BACKTRACE").is_none() {
|
if std::env::var_os("RUST_BACKTRACE").is_none() {
|
||||||
unsafe { std::env::set_var("RUST_BACKTRACE", "1"); }
|
unsafe { std::env::set_var("RUST_BACKTRACE", "1"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "nightly-diagnostics")]
|
||||||
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
||||||
|
|
||||||
// rustls 0.23 requires an explicit process-wide CryptoProvider
|
// rustls 0.23 requires an explicit process-wide CryptoProvider
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(async_fn_track_caller)]
|
#![cfg_attr(feature = "nightly-diagnostics", feature(async_fn_track_caller))]
|
||||||
|
|
||||||
// consciousness — unified crate for memory, agents, and subconscious processes
|
// consciousness — unified crate for memory, agents, and subconscious processes
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ impl<T> TrackedMutex<T> {
|
||||||
Self { inner: Mutex::new(value) }
|
Self { inner: Mutex::new(value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||||
pub async fn lock(&self) -> TrackedMutexGuard<'_, T> {
|
pub async fn lock(&self) -> TrackedMutexGuard<'_, T> {
|
||||||
let location = Location::caller();
|
let location = Location::caller();
|
||||||
let guard = self.inner.lock().await;
|
let guard = self.inner.lock().await;
|
||||||
|
|
@ -125,7 +125,7 @@ impl<T> TrackedMutex<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||||
pub fn try_lock(&self) -> Result<TrackedMutexGuard<'_, T>, tokio::sync::TryLockError> {
|
pub fn try_lock(&self) -> Result<TrackedMutexGuard<'_, T>, tokio::sync::TryLockError> {
|
||||||
let location = Location::caller();
|
let location = Location::caller();
|
||||||
let guard = self.inner.try_lock()?;
|
let guard = self.inner.try_lock()?;
|
||||||
|
|
@ -171,7 +171,7 @@ impl<T> TrackedRwLock<T> {
|
||||||
Self { inner: RwLock::new(value) }
|
Self { inner: RwLock::new(value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||||
pub async fn read(&self) -> TrackedRwLockReadGuard<'_, T> {
|
pub async fn read(&self) -> TrackedRwLockReadGuard<'_, T> {
|
||||||
let location = Location::caller();
|
let location = Location::caller();
|
||||||
let guard = self.inner.read().await;
|
let guard = self.inner.read().await;
|
||||||
|
|
@ -182,7 +182,7 @@ impl<T> TrackedRwLock<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||||
pub async fn write(&self) -> TrackedRwLockWriteGuard<'_, T> {
|
pub async fn write(&self) -> TrackedRwLockWriteGuard<'_, T> {
|
||||||
let location = Location::caller();
|
let location = Location::caller();
|
||||||
let guard = self.inner.write().await;
|
let guard = self.inner.write().await;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(panic_backtrace_config)]
|
#![cfg_attr(feature = "nightly-diagnostics", feature(panic_backtrace_config))]
|
||||||
|
|
||||||
// poc-memory: graph-structured memory for AI assistants
|
// poc-memory: graph-structured memory for AI assistants
|
||||||
//
|
//
|
||||||
|
|
@ -464,6 +464,7 @@ impl Run for AdminCmd {
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
|
#[cfg(feature = "nightly-diagnostics")]
|
||||||
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
||||||
|
|
||||||
// Handle --help ourselves for expanded subcommand display
|
// Handle --help ourselves for expanded subcommand display
|
||||||
|
|
@ -495,4 +496,3 @@ async fn main() {
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue