2015-04-07 12:10:53 +02:00
|
|
|
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
//! Various data structures used by the Rust compiler. The intention
|
|
|
|
//! is that code in here should be not be *specific* to rustc, so that
|
|
|
|
//! it can be easily unit tested and so forth.
|
|
|
|
//!
|
|
|
|
//! # Note
|
|
|
|
//!
|
|
|
|
//! This API is completely unstable and subject to change.
|
|
|
|
|
2015-08-09 23:15:05 +02:00
|
|
|
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
|
|
|
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
|
|
|
|
html_root_url = "https://doc.rust-lang.org/nightly/")]
|
2015-04-07 12:10:53 +02:00
|
|
|
|
2017-06-30 20:34:53 +02:00
|
|
|
#![feature(collections_range)]
|
2016-05-07 23:52:45 +02:00
|
|
|
#![feature(unboxed_closures)]
|
|
|
|
#![feature(fn_traits)]
|
2016-10-25 02:22:59 +02:00
|
|
|
#![feature(unsize)]
|
2017-03-30 15:27:27 +02:00
|
|
|
#![feature(specialization)]
|
2017-12-03 13:49:01 +01:00
|
|
|
#![feature(optin_builtin_traits)]
|
|
|
|
#![feature(macro_vis_matcher)]
|
|
|
|
#![feature(allow_internal_unstable)]
|
2015-08-18 23:56:55 +02:00
|
|
|
|
2016-08-22 19:01:46 +02:00
|
|
|
#![cfg_attr(unix, feature(libc))]
|
2015-04-09 00:53:56 +02:00
|
|
|
#![cfg_attr(test, feature(test))]
|
2015-04-07 12:10:53 +02:00
|
|
|
|
2015-11-18 20:44:24 +01:00
|
|
|
extern crate core;
|
2017-07-16 13:07:51 +02:00
|
|
|
extern crate ena;
|
2016-03-05 14:40:33 +01:00
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
2015-04-07 12:10:53 +02:00
|
|
|
extern crate serialize as rustc_serialize; // used by deriving
|
2016-08-13 00:22:02 +02:00
|
|
|
#[cfg(unix)]
|
|
|
|
extern crate libc;
|
2017-12-03 13:49:01 +01:00
|
|
|
extern crate parking_lot;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate cfg_if;
|
|
|
|
extern crate stable_deref_trait;
|
2018-04-26 00:50:33 +02:00
|
|
|
extern crate rustc_rayon as rayon;
|
2018-05-24 14:48:02 +02:00
|
|
|
extern crate rustc_hash;
|
2015-04-07 12:11:49 +02:00
|
|
|
|
2018-04-25 18:30:39 +02:00
|
|
|
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
|
|
|
|
#[allow(unused_extern_crates)]
|
|
|
|
extern crate rustc_cratesio_shim;
|
|
|
|
|
2016-12-14 00:45:03 +01:00
|
|
|
pub use rustc_serialize::hex::ToHex;
|
|
|
|
|
2016-10-25 02:22:59 +02:00
|
|
|
pub mod array_vec;
|
|
|
|
pub mod accumulate_vec;
|
2016-11-03 05:33:35 +01:00
|
|
|
pub mod small_vec;
|
2016-11-04 22:37:42 +01:00
|
|
|
pub mod base_n;
|
2016-10-06 04:43:27 +02:00
|
|
|
pub mod bitslice;
|
2015-04-07 12:12:13 +02:00
|
|
|
pub mod bitvec;
|
2015-08-18 23:37:15 +02:00
|
|
|
pub mod graph;
|
2016-10-06 04:43:27 +02:00
|
|
|
pub mod indexed_set;
|
2016-06-07 16:28:36 +02:00
|
|
|
pub mod indexed_vec;
|
2015-11-18 20:44:24 +01:00
|
|
|
pub mod obligation_forest;
|
2017-10-16 13:16:04 +02:00
|
|
|
pub mod sip128;
|
2016-05-21 14:18:09 +02:00
|
|
|
pub mod snapshot_map;
|
2017-07-16 13:07:51 +02:00
|
|
|
pub use ena::snapshot_vec;
|
2016-12-14 00:45:03 +01:00
|
|
|
pub mod stable_hasher;
|
2015-08-18 23:38:19 +02:00
|
|
|
pub mod transitive_relation;
|
2017-07-16 13:07:51 +02:00
|
|
|
pub use ena::unify;
|
2016-11-08 04:02:55 +01:00
|
|
|
pub mod fx;
|
2015-12-10 20:35:53 +01:00
|
|
|
pub mod tuple_slice;
|
2016-06-10 00:49:07 +02:00
|
|
|
pub mod control_flow_graph;
|
2016-08-13 00:22:02 +02:00
|
|
|
pub mod flock;
|
2017-12-03 13:49:01 +01:00
|
|
|
pub mod sync;
|
|
|
|
pub mod owning_ref;
|
2018-05-18 11:48:11 +02:00
|
|
|
pub mod sorted_map;
|
2015-08-11 20:48:43 +02:00
|
|
|
|
2018-03-15 10:38:12 +01:00
|
|
|
pub struct OnDrop<F: Fn()>(pub F);
|
|
|
|
|
|
|
|
impl<F: Fn()> Drop for OnDrop<F> {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
(self.0)();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-11 20:48:43 +02:00
|
|
|
// See comments in src/librustc/lib.rs
|
|
|
|
#[doc(hidden)]
|
|
|
|
pub fn __noop_fix_for_27438() {}
|