]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/issue-55001.rs
Rollup merge of #91519 - petrochenkov:cratexp2, r=Aaron1011
[rust.git] / src / test / rustdoc / issue-55001.rs
1 // Regression test for issue #55001. Previously, we would incorrectly
2 // cache certain trait selection results when checking for blanket impls,
3 // resulting in an ICE when we tried to confirm the cached ParamCandidate
4 // against an obligation.
5
6 pub struct DefaultAllocator;
7 pub struct Standard;
8 pub struct Inner;
9
10 pub trait Rand {}
11
12 pub trait Distribution<T> {}
13 pub trait Allocator<N> {}
14
15 impl<T> Rand for T where Standard: Distribution<T> {}
16
17 impl<A> Distribution<Point<A>> for Standard
18 where
19 DefaultAllocator: Allocator<A>,
20 Standard: Distribution<A> {}
21
22 impl Distribution<Inner> for Standard {}
23
24
25 pub struct Point<N>
26 where DefaultAllocator: Allocator<N>
27 {
28     field: N
29 }
30
31 fn main() {}