1#![feature(
14 rustc_private,
15 negative_impls, min_specialization, type_alias_impl_trait, box_patterns, exact_size_is_empty, impl_trait_in_assoc_type,
21 doc_auto_cfg, )]
23#![warn(clippy::pedantic)]
24#![allow(
25 clippy::len_zero,
26 clippy::len_without_is_empty,
27 clippy::must_use_candidate,
28 clippy::return_self_not_must_use,
29 clippy::missing_panics_doc,
30 clippy::missing_errors_doc,
31 clippy::doc_markdown,
32 clippy::single_match_else,
33 clippy::if_not_else,
34 clippy::map_unwrap_or,
35 clippy::match_wildcard_for_single_variants,
36 clippy::items_after_statements,
37 clippy::implicit_hasher,
38 clippy::wildcard_imports
39)]
40
41extern crate either;
42extern crate rustc_abi;
43extern crate rustc_borrowck;
44extern crate rustc_data_structures;
45extern crate rustc_driver;
46extern crate rustc_errors;
47extern crate rustc_graphviz;
48extern crate rustc_hir;
49extern crate rustc_index;
50extern crate rustc_infer;
51extern crate rustc_interface;
52extern crate rustc_lint_defs;
53extern crate rustc_macros;
54extern crate rustc_middle;
55extern crate rustc_mir_dataflow;
56extern crate rustc_mir_transform;
57extern crate rustc_serialize;
58extern crate rustc_session;
59extern crate rustc_span;
60extern crate rustc_target;
61extern crate rustc_trait_selection;
62extern crate rustc_type_ir;
63extern crate smallvec;
64
65pub mod cache;
66pub mod hir;
67pub mod mir;
68pub mod source_map;
69#[cfg(feature = "test")]
70pub mod test_utils;
71pub mod timer;
72
73pub use crate::{
74 hir::ty::TyExt,
75 mir::{
76 adt_def::AdtDefExt, body::BodyExt, mutability::MutabilityExt, operand::OperandExt,
77 place::PlaceExt,
78 },
79 source_map::span::{SpanDataExt, SpanExt},
80};
81
82#[macro_export]
84macro_rules! hashset {
85 (@single $($x:tt)*) => (());
86 (@count $($rest:expr),*) => (<[()]>::len(&[$(hashset!(@single $rest)),*]));
87
88 ($($key:expr,)+) => { hashset!($($key),+) };
89 ($($key:expr),*) => {
90 {
91 let _cap = hashset!(@count $($key),*);
92 let mut _set = ::rustc_data_structures::fx::FxHashSet::default();
93 let _ = _set.try_reserve(_cap);
94 $(
95 let _ = _set.insert($key);
96 )*
97 _set
98 }
99 };
100}