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
//! Compile-time diagnostic construction.
//!
//! Central entry point; the error span is threaded through every call:
//! [`compile_err!`] keeps the macro call site (no span), while
//! [`compile_err_at!`] attaches an explicit span (``compile_err_at!(span,
//! "msg {}")``) — precise spans are added incrementally at the error points
//! where the offending token is in hand.
use ;
use quote;
/// Build `compile_error!(msg);` at `span` (the token the error is about).
pub
/// `compile_err!("msg {}", x)` → `compile_error_str(&format!(...), call_site)`.
pub use compile_err;
/// `compile_err_at!(span, "msg {}", x)` → `compile_error_str(&format!(...), span)`.
/// Use where the offending token's span is in hand (parse cursor position,
/// `@` reference, directive argument group, `Ty::span`).
pub use compile_err_at;