Skip to main content

sva_formula/
origin.rs

1// Concern: declares Origin, the opaque token a refusal names a subterm by | Non-concern: resolving one to file:line:col (sva-engine) | IO: none
2
3/// Excluded from every hash and every sort key: two spellings written in different files
4/// are one value.
5#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
6pub struct Origin(u32);
7
8impl Origin {
9    pub const UNKNOWN: Origin = Origin(u32::MAX);
10
11    pub fn new(token: u32) -> Origin {
12        Origin(token)
13    }
14
15    pub fn token(self) -> u32 {
16        self.0
17    }
18}