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
60
//! The composition roots where a direct environment read is sanctioned.
//!
//! ADR-0012 permits a direct read only at a genuine composition root, under an
//! item-scoped `#[expect(..., reason = "...")]` that warns once a seam becomes
//! available. Exempting every item-scoped `expect`, as this scan first did,
//! honoured the attribute but not the rule: a contributor could put the same
//! attribute on any function, add a `std::env` read beneath it, and pass both
//! Clippy and the scan. The roots are therefore named here, and an `expect` of
//! a protected lint anywhere else is an offence.
//!
//! Adding an entry is a policy decision, not a mechanical one: it belongs in
//! the same change as the ADR paragraph and the guide row that explain why the
//! site has no seam.
use Utf8Path;
/// The file and item of each sanctioned composition root.
///
/// Both are executable roots that cannot be given a seam. `write_failure_child`
/// is re-executed by its parent, so the child's environment is the only channel
/// in; `ambient_variable` reads `PROPTEST_CASES`, proptest's own knob, set by
/// whoever runs the suite rather than by any caller in this repository.
pub const SANCTIONED_ROOTS: = ;
/// Return whether `path` is exactly `expected`, written with `/`.
///
/// Components are compared rather than the rendered string, because the walk
/// joins paths with the platform separator: on Windows every path reads
/// `tests\rewrite_atomic.rs`, and a string comparison would match nothing
/// there while matching on Linux, which is a contract that guards one platform
/// and not the other.
/// Return whether an item-scoped `expect` at `path` sits on a sanctioned root.
///
/// An attribute with no enclosing named item is never sanctioned: a crate-root
/// attribute covers everything in the file, which is the evasion the scan
/// exists to report, and there is no item whose absence of a seam could have
/// been argued.