1 //! This is a reproducer for the ICE 6840: https://github.com/rust-lang/rust-clippy/issues/6840.
2 //! The ICE is caused by `TyCtxt::layout_of` and `is_normalizable` not being strict enough
4 use std::collections::HashMap;
10 pub struct RuleEdges<R: Rule> {
11 dependencies: R::DependencyKey,
14 type RuleDependencyEdges<R> = HashMap<u32, RuleEdges<R>>;
16 // reproducer from the GitHub issue ends here
17 // but check some additional variants
18 type RuleDependencyEdgesArray<R> = HashMap<u32, [RuleEdges<R>; 8]>;
19 type RuleDependencyEdgesSlice<R> = HashMap<u32, &'static [RuleEdges<R>]>;
20 type RuleDependencyEdgesRef<R> = HashMap<u32, &'static RuleEdges<R>>;
21 type RuleDependencyEdgesRaw<R> = HashMap<u32, *const RuleEdges<R>>;
22 type RuleDependencyEdgesTuple<R> = HashMap<u32, (RuleEdges<R>, RuleEdges<R>)>;
24 // and an additional checks to make sure fix doesn't have stack-overflow issue
25 // on self-containing types
26 pub struct SelfContaining {
27 inner: Box<SelfContaining>,
29 type SelfContainingEdges = HashMap<u32, SelfContaining>;