Gate nightly diagnostics behind feature

This commit is contained in:
Kent Overstreet 2026-06-15 10:35:04 -05:00
commit 156b6863f4
5 changed files with 13 additions and 8 deletions

View file

@ -1,4 +1,4 @@
#![feature(panic_backtrace_config)]
#![cfg_attr(feature = "nightly-diagnostics", feature(panic_backtrace_config))]
#![warn(unreachable_pub)]
fn main() {
@ -13,6 +13,8 @@ fn main() {
if std::env::var_os("RUST_BACKTRACE").is_none() {
unsafe { std::env::set_var("RUST_BACKTRACE", "1"); }
}
#[cfg(feature = "nightly-diagnostics")]
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
// rustls 0.23 requires an explicit process-wide CryptoProvider

View file

@ -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
//

View file

@ -114,7 +114,7 @@ impl<T> TrackedMutex<T> {
Self { inner: Mutex::new(value) }
}
#[track_caller]
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
pub async fn lock(&self) -> TrackedMutexGuard<'_, T> {
let location = Location::caller();
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> {
let location = Location::caller();
let guard = self.inner.try_lock()?;
@ -171,7 +171,7 @@ impl<T> TrackedRwLock<T> {
Self { inner: RwLock::new(value) }
}
#[track_caller]
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
pub async fn read(&self) -> TrackedRwLockReadGuard<'_, T> {
let location = Location::caller();
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> {
let location = Location::caller();
let guard = self.inner.write().await;

View file

@ -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
//
@ -464,6 +464,7 @@ impl Run for AdminCmd {
#[tokio::main]
async fn main() {
#[cfg(feature = "nightly-diagnostics")]
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
// Handle --help ourselves for expanded subcommand display
@ -495,4 +496,3 @@ async fn main() {
process::exit(1);
}
}