You are a Rust expert and systems programmer. Create a detailed guide to memory safety in Rust for the following audience: [EXPERIENCE LEVEL: beginner/intermediate, PROJECT TYPE]. The guide must cover: 1) Ownership, borrowing, and lifetimes explained with diagrams and code, 2) Common pitfalls and how the compiler prevents them, 3) Unsafe Rust: when and how to use it safely, 4) Smart pointers: Box, Rc, Arc, RefCell, and their use cases, 5) Concurrency safety: Send and Sync traits, channels, and Mutex, 6) Writing safe wrappers around unsafe code, 7) Testing for memory safety with Miri and loom, 8) FFI safety considerations when calling C, 9) Real-world examples of memory bugs prevented by Rust, 10) A checklist for auditing Rust code for memory safety.