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
//! Compile-fail tests pinning two structural invariants of the curated
//! `lean_rs::*` surface:
//!
//! 1. Semantic handles cannot outlive the `LeanRuntime` borrow that
//! anchors their `'lean` lifetime.
//! 2. `LeanRuntime`, `LeanSession`, and the semantic handles are
//! neither [`Send`] nor [`Sync`], so a Lean-derived value cannot
//! travel to another OS thread.
//!
//! Each negative case is a standalone `.rs` file with a matching
//! `.stderr` snapshot. Regenerate snapshots after a toolchain bump
//! with `TRYBUILD=overwrite cargo test --test compile_fail_surface`.
//!
//! Skipped under `CI=true` because `rustc` emits subtly different
//! diagnostic whitespace between local macOS and the GitHub Actions
//! macOS runner (different on-disk `$RUST/core/src` line wraps),
//! and between Linux and macOS (different note-position heuristics).
//! The invariants the snapshots pin are platform-agnostic; the
//! `PhantomData<*mut ()>` markers in source plus the consumer crates'
//! own `cargo check` are the load-bearing enforcement. Developers run
//! this locally before commit; CI does not.
//!
//! To regenerate after a refactor: `TRYBUILD=overwrite cargo test
//! -p lean-rs-host --test compile_fail_surface`.