#![allow(internal_features)]
#![cfg_attr(test, feature(test))]
#![deny(unsafe_op_in_unsafe_fn)]
#[macro_use]
use alloc::borrow::ToOwned;
use alloc::boxed::Box;
use alloc::format;
use alloc::string::{String, ToString};
use alloc::vec;
use alloc::vec::Vec;
extern crate self as rustc_data_structures;
use core::fmt;
pub use atomic_ref::AtomicRef;
pub use crate::ena::{snapshot_vec, undo_log, unify};
pub use hashbrown::hash_table;
pub use crate::static_assert_size;
pub use {either, indexmap, smallvec, thin_vec};
pub mod aligned;
pub mod base_n;
pub mod binary_search_util;
pub mod fingerprint;
pub mod flat_map_in_place;
pub mod flock;
pub mod frozen;
pub mod fx;
pub mod graph;
pub mod intern;
pub mod iter_ext;
pub mod marker;
pub mod memmap;
pub mod obligation_forest;
pub mod owned_slice;
pub mod packed;
pub mod profiling;
pub mod range_set;
pub mod sharded;
pub mod small_c_str;
pub mod snapshot_map;
pub mod sorted_map;
pub mod sso;
pub mod stable_hash;
pub mod steal;
pub mod svh;
pub mod sync;
pub mod tagged_ptr;
pub mod temp_dir;
pub mod thousands;
pub mod transitive_relation;
pub mod unhash;
pub mod union_find;
pub mod unord;
pub mod vec_cache;
mod assert_matches;
mod atomic_ref;
#[inline(never)]
#[cold]
pub fn outline<F: FnOnce() -> R, R>(f: F) -> R {
f()
}
pub fn defer<F: FnOnce()>(f: F) -> OnDrop<F> {
OnDrop(Some(f))
}
pub struct OnDrop<F: FnOnce()>(Option<F>);
impl<F: FnOnce()> OnDrop<F> {
#[inline]
pub fn disable(mut self) {
self.0.take();
}
}
impl<F: FnOnce()> Drop for OnDrop<F> {
#[inline]
fn drop(&mut self) {
if let Some(f) = self.0.take() {
f();
}
}
}
pub struct FatalErrorMarker;
pub fn make_display(f: impl Fn(&mut fmt::Formatter<'_>) -> fmt::Result) -> impl fmt::Display {
struct Printer<F> {
f: F,
}
impl<F> fmt::Display for Printer<F>
where
F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result,
{
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
(self.f)(fmt)
}
}
Printer { f }
}
#[doc(hidden)]
pub fn __noop_fix_for_windows_dllimport_issue() {}
#[doc(hidden)]
#[macro_export]
macro_rules! metavar_ignore {
([$($ignored:tt)*] $($keep:tt)*) => {
$($keep)*
};
}
#[macro_export]
macro_rules! external_bitflags_debug {
($Name:ident) => {
impl ::core::fmt::Debug for $Name {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
::bitflags::parser::to_writer(self, f)
}
}
};
}
pub use crate::define_id_collections;
pub use crate::define_stable_id_collections;
pub use crate::external_bitflags_debug;