]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/issue-55241.rs
Re-add #[allow(unused)] attr
[rust.git] / tests / ui / nll / user-annotations / issue-55241.rs
1 // Regression test for #55241:
2 //
3 // The reference to `C::HASHED_NULL_NODE` resulted in a type like `<C
4 // as NodeCodec<_>>::Out`; normalizing this type requires knowing the
5 // value of `_`; solving that requires having normalized, so we can
6 // test against `C: NodeCodec<H>` in the environment.
7 //
8 // run-pass
9
10 pub trait Hasher {
11     type Out: Eq;
12 }
13
14 pub trait NodeCodec<H: Hasher> {
15     const HASHED_NULL_NODE: H::Out;
16 }
17
18 pub trait Trie<H: Hasher, C: NodeCodec<H>> {
19     /// Returns the root of the trie.
20     fn root(&self) -> &H::Out;
21
22     /// Is the trie empty?
23     fn is_empty(&self) -> bool { *self.root() == C::HASHED_NULL_NODE }
24 }
25
26 fn main() { }