//! This is a reproducer for the ICE 6840: https://github.com/rust-lang/rust-clippy/issues/6840. //! The ICE is caused by `TyCtxt::layout_of` and `is_normalizable` not being strict enough #![allow(dead_code)] use std::collections::HashMap; pub trait Rule { type DependencyKey; } pub struct RuleEdges { dependencies: R::DependencyKey, } type RuleDependencyEdges = HashMap>; // reproducer from the GitHub issue ends here // but check some additional variants type RuleDependencyEdgesArray = HashMap; 8]>; type RuleDependencyEdgesSlice = HashMap]>; type RuleDependencyEdgesRef = HashMap>; type RuleDependencyEdgesRaw = HashMap>; type RuleDependencyEdgesTuple = HashMap, RuleEdges)>; // and an additional checks to make sure fix doesn't have stack-overflow issue // on self-containing types pub struct SelfContaining { inner: Box, } type SelfContainingEdges = HashMap; fn main() {}