forked from obi1kenobi/cargo-semver-checks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.rs
40 lines (32 loc) · 1.02 KB
/
lib.rs
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
// Traits transitioning from Unconditionally Sealed → Unsealed (Lint should detect these)
pub mod unconditionally_sealed_to_unsealed {
pub mod hidden {
pub trait Sealed {}
pub struct Token;
}
pub trait ExtendsTraitInHiddenModule: hidden::Sealed {}
pub trait TransitivelyTraitSealed: ExtendsTraitInHiddenModule {}
pub trait ReturnsTraitInHiddenModule {
fn method(&self) -> hidden::Token;
}
pub trait AcceptsTraitInHiddenModule {
fn method(&self, token: hidden::Token);
}
pub trait SealedWithWhereSelfBound
where
Self: hidden::Sealed,
{
}
}
// Traits transitioning from Unconditionally Sealed -> Public API Sealed (Lint should not detect these)
pub mod unconditionally_sealed_to_public_api_sealed {
#[doc(hidden)]
pub mod hidden {
pub trait Sealed {}
pub struct Token;
}
pub trait ExtendsTraitInHiddenModule: hidden::Sealed {}
pub trait ReturnsTraitInHiddenModule {
fn method(&self) -> hidden::Token;
}
}