]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/crashes/ice-6840.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / crashes / ice-6840.rs
CommitLineData
f20569fa
XL
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
3#![allow(dead_code)]
4use std::collections::HashMap;
5
6pub trait Rule {
7 type DependencyKey;
8}
9
10pub struct RuleEdges<R: Rule> {
11 dependencies: R::DependencyKey,
12}
13
14type RuleDependencyEdges<R> = HashMap<u32, RuleEdges<R>>;
15
16// reproducer from the GitHub issue ends here
17// but check some additional variants
18type RuleDependencyEdgesArray<R> = HashMap<u32, [RuleEdges<R>; 8]>;
19type RuleDependencyEdgesSlice<R> = HashMap<u32, &'static [RuleEdges<R>]>;
20type RuleDependencyEdgesRef<R> = HashMap<u32, &'static RuleEdges<R>>;
21type RuleDependencyEdgesRaw<R> = HashMap<u32, *const RuleEdges<R>>;
22type RuleDependencyEdgesTuple<R> = HashMap<u32, (RuleEdges<R>, RuleEdges<R>)>;
23
24// and an additional checks to make sure fix doesn't have stack-overflow issue
25// on self-containing types
26pub struct SelfContaining {
27 inner: Box<SelfContaining>,
28}
29type SelfContainingEdges = HashMap<u32, SelfContaining>;
30
31fn main() {}