1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Lightweight graph-based compilation safety checks.
//!
//! This module provides fast pre-mutation validation using the existing
//! `CodeGraph` and `SymbolRegistry` infrastructure. It's not a full type checker,
//! but catches common mutation errors quickly.
//!
//! # Design Philosophy
//!
//! - **Speed over completeness**: 10-100x faster than `cargo check`
//! - **Leverage existing infrastructure**: Uses `CodeGraph` edges and `SymbolRegistry`
//! - **Fail fast**: Catch obvious errors before expensive compilation
//!
//! # Capabilities
//!
//! - Symbol existence checks
//! - Known trait implementation verification
//! - Derive possibility checks (field types implement required traits)
//! - Borrow conflict analysis (via `DataFlowGraphV2::borrow_analysis()`)
//!
//! # Limitations
//!
//! Cannot handle: generics resolution, type inference, complex lifetimes.
//! Use `cargo check` for final validation.
//!
//! # Usage
//!
//! ```rust,ignore
//! use ryo_analysis::{GraphChecker, CodeGraph, SymbolRegistry};
//!
//! let checker = GraphChecker::new(&graph, &typeflow, ®istry);
//!
//! // Quick symbol existence check
//! if checker.check_symbol_exists("MyStruct") {
//! // Symbol exists
//! }
//!
//! // Check if derive is possible
//! match checker.check_derive_possible("MyStruct", "Default") {
//! CheckResult::Ok => { /* proceed with mutation */ }
//! CheckResult::Error(errors) => { /* abort or cascade */ }
//! _ => {}
//! }
//!
//! // Borrow conflict detection: use BorrowTrackerV2.conflicts() directly
//! let tracker = dataflow.borrow_tracker();
//! let conflicts = tracker.conflicts(var_id, BorrowKind::Mutable, 10);
//! ```
pub use ;
pub use GraphChecker;
pub use ;
pub use LightCheck;