2020-02-17 19:04:06 +01:00
|
|
|
use crate::dep_graph::{self, DepConstructor, DepNode};
|
2020-01-02 04:53:12 +01:00
|
|
|
use crate::hir::exports::Export;
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::infer::canonical::{self, Canonical};
|
2020-01-05 10:58:44 +01:00
|
|
|
use crate::lint::LintLevelMap;
|
2019-12-24 05:30:02 +01:00
|
|
|
use crate::middle::codegen_fn_attrs::CodegenFnAttrs;
|
2019-12-22 17:42:04 -05:00
|
|
|
use crate::middle::cstore::{CrateSource, DepKind, NativeLibraryKind};
|
|
|
|
use crate::middle::cstore::{ExternCrate, ForeignModule, LinkagePreference, NativeLibrary};
|
|
|
|
use crate::middle::exported_symbols::{ExportedSymbol, SymbolExportLevel};
|
|
|
|
use crate::middle::lang_items::{LangItem, LanguageItems};
|
|
|
|
use crate::middle::lib_features::LibFeatures;
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::middle::privacy::AccessLevels;
|
|
|
|
use crate::middle::region;
|
2019-12-22 17:42:04 -05:00
|
|
|
use crate::middle::resolve_lifetime::{ObjectLifetimeDefault, Region, ResolveLifetimes};
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::middle::stability::{self, DeprecationEntry};
|
|
|
|
use crate::mir;
|
|
|
|
use crate::mir::interpret::GlobalId;
|
2020-02-15 12:57:46 +13:00
|
|
|
use crate::mir::interpret::{ConstEvalRawResult, ConstEvalResult, ConstValue};
|
2020-01-11 15:22:36 +13:00
|
|
|
use crate::mir::interpret::{LitToConstError, LitToConstInput};
|
2019-12-22 17:42:04 -05:00
|
|
|
use crate::mir::mono::CodegenUnit;
|
|
|
|
use crate::session::config::{EntryFnType, OptLevel, OutputFilenames, SymbolManglingVersion};
|
2018-12-08 20:30:23 +01:00
|
|
|
use crate::session::CrateDisambiguator;
|
2019-12-22 17:42:04 -05:00
|
|
|
use crate::traits::query::{
|
|
|
|
CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal,
|
|
|
|
CanonicalTypeOpAscribeUserTypeGoal, CanonicalTypeOpEqGoal, CanonicalTypeOpNormalizeGoal,
|
|
|
|
CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpSubtypeGoal, NoSolution,
|
|
|
|
};
|
2020-01-06 20:13:24 +01:00
|
|
|
use crate::traits::query::{
|
|
|
|
DropckOutlivesResult, DtorckConstraint, MethodAutoderefStepsResult, NormalizationResult,
|
|
|
|
OutlivesBound,
|
|
|
|
};
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::traits::specialization_graph;
|
|
|
|
use crate::traits::Clauses;
|
2019-12-22 17:42:04 -05:00
|
|
|
use crate::traits::{self, Vtable};
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::ty::steal::Steal;
|
2019-02-09 22:11:53 +08:00
|
|
|
use crate::ty::subst::SubstsRef;
|
2020-01-30 20:28:16 +00:00
|
|
|
use crate::ty::util::AlwaysRequiresDrop;
|
2019-12-22 17:42:04 -05:00
|
|
|
use crate::ty::{self, AdtSizedConstraint, CrateInherentImpls, ParamEnvAnd, Ty, TyCtxt};
|
2019-09-26 05:30:10 +00:00
|
|
|
use crate::util::common::ErrorReported;
|
2019-12-22 17:42:04 -05:00
|
|
|
use rustc_data_structures::fingerprint::Fingerprint;
|
|
|
|
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
|
2020-01-05 02:37:57 +01:00
|
|
|
use rustc_data_structures::profiling::ProfileCategory::*;
|
2017-09-14 17:40:37 +02:00
|
|
|
use rustc_data_structures::stable_hasher::StableVec;
|
2019-12-22 17:42:04 -05:00
|
|
|
use rustc_data_structures::svh::Svh;
|
Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.
Currently we have two files implementing bitsets (and 2D bit matrices).
This commit combines them into one, taking the best features from each.
This involves renaming a lot of things. The high level changes are as
follows.
- bitvec.rs --> bit_set.rs
- indexed_set.rs --> (removed)
- BitArray + IdxSet --> BitSet (merged, see below)
- BitVector --> GrowableBitSet
- {,Sparse,Hybrid}IdxSet --> {,Sparse,Hybrid}BitSet
- BitMatrix --> BitMatrix
- SparseBitMatrix --> SparseBitMatrix
The changes within the bitset types themselves are as follows.
```
OLD OLD NEW
BitArray<C> IdxSet<T> BitSet<T>
-------- ------ ------
grow - grow
new - (remove)
new_empty new_empty new_empty
new_filled new_filled new_filled
- to_hybrid to_hybrid
clear clear clear
set_up_to set_up_to set_up_to
clear_above - clear_above
count - count
contains(T) contains(&T) contains(T)
contains_all - superset
is_empty - is_empty
insert(T) add(&T) insert(T)
insert_all - insert_all()
remove(T) remove(&T) remove(T)
words words words
words_mut words_mut words_mut
- overwrite overwrite
merge union union
- subtract subtract
- intersect intersect
iter iter iter
```
In general, when choosing names I went with:
- names that are more obvious (e.g. `BitSet` over `IdxSet`).
- names that are more like the Rust libraries (e.g. `T` over `C`,
`insert` over `add`);
- names that are more set-like (e.g. `union` over `merge`, `superset`
over `contains_all`, `domain_size` over `num_bits`).
Also, using `T` for index arguments seems more sensible than `&T` --
even though the latter is standard in Rust collection types -- because
indices are always copyable. It also results in fewer `&` and `*`
sigils in practice.
2018-09-14 15:07:25 +10:00
|
|
|
use rustc_data_structures::sync::Lrc;
|
2020-01-05 02:37:57 +01:00
|
|
|
use rustc_hir as hir;
|
|
|
|
use rustc_hir::def::DefKind;
|
|
|
|
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, DefIndex};
|
2020-02-06 12:16:51 +01:00
|
|
|
use rustc_hir::{Crate, HirIdSet, ItemLocalId, TraitCandidate};
|
2019-12-22 17:42:04 -05:00
|
|
|
use rustc_index::vec::IndexVec;
|
Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.
Currently we have two files implementing bitsets (and 2D bit matrices).
This commit combines them into one, taking the best features from each.
This involves renaming a lot of things. The high level changes are as
follows.
- bitvec.rs --> bit_set.rs
- indexed_set.rs --> (removed)
- BitArray + IdxSet --> BitSet (merged, see below)
- BitVector --> GrowableBitSet
- {,Sparse,Hybrid}IdxSet --> {,Sparse,Hybrid}BitSet
- BitMatrix --> BitMatrix
- SparseBitMatrix --> SparseBitMatrix
The changes within the bitset types themselves are as follows.
```
OLD OLD NEW
BitArray<C> IdxSet<T> BitSet<T>
-------- ------ ------
grow - grow
new - (remove)
new_empty new_empty new_empty
new_filled new_filled new_filled
- to_hybrid to_hybrid
clear clear clear
set_up_to set_up_to set_up_to
clear_above - clear_above
count - count
contains(T) contains(&T) contains(T)
contains_all - superset
is_empty - is_empty
insert(T) add(&T) insert(T)
insert_all - insert_all()
remove(T) remove(&T) remove(T)
words words words
words_mut words_mut words_mut
- overwrite overwrite
merge union union
- subtract subtract
- intersect intersect
iter iter iter
```
In general, when choosing names I went with:
- names that are more obvious (e.g. `BitSet` over `IdxSet`).
- names that are more like the Rust libraries (e.g. `T` over `C`,
`insert` over `add`);
- names that are more set-like (e.g. `union` over `merge`, `superset`
over `contains_all`, `domain_size` over `num_bits`).
Also, using `T` for index arguments seems more sensible than `&T` --
even though the latter is standard in Rust collection types -- because
indices are always copyable. It also results in fewer `&` and `*`
sigils in practice.
2018-09-14 15:07:25 +10:00
|
|
|
use rustc_target::spec::PanicStrategy;
|
2017-09-07 16:11:58 +02:00
|
|
|
|
2020-02-29 20:37:32 +03:00
|
|
|
use rustc_ast::ast;
|
2020-01-11 13:15:20 +01:00
|
|
|
use rustc_attr as attr;
|
2020-01-01 19:30:57 +01:00
|
|
|
use rustc_span::symbol::Symbol;
|
2019-12-31 20:15:40 +03:00
|
|
|
use rustc_span::{Span, DUMMY_SP};
|
2018-10-01 15:31:27 +02:00
|
|
|
use std::borrow::Cow;
|
2020-02-12 11:50:00 +01:00
|
|
|
use std::convert::TryFrom;
|
2017-04-24 18:06:39 +03:00
|
|
|
use std::ops::Deref;
|
2017-09-12 09:32:37 -07:00
|
|
|
use std::sync::Arc;
|
2015-12-22 16:39:33 -05:00
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
#[macro_use]
|
|
|
|
mod plumbing;
|
|
|
|
use self::plumbing::*;
|
2018-04-06 12:56:59 +02:00
|
|
|
pub use self::plumbing::{force_from_dep_node, CycleError};
|
2017-09-12 11:04:46 -07:00
|
|
|
|
2020-02-15 09:48:10 +01:00
|
|
|
mod stats;
|
|
|
|
pub use self::stats::print_stats;
|
|
|
|
|
2018-03-15 10:03:36 +01:00
|
|
|
mod job;
|
2019-01-28 15:51:47 +01:00
|
|
|
#[cfg(parallel_compiler)]
|
2018-04-06 12:56:59 +02:00
|
|
|
pub use self::job::handle_deadlock;
|
2020-01-31 04:00:03 +01:00
|
|
|
use self::job::QueryJobInfo;
|
2020-02-12 11:50:00 +01:00
|
|
|
pub use self::job::{QueryInfo, QueryJob, QueryJobId};
|
2018-03-15 10:03:36 +01:00
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
mod keys;
|
2018-06-13 16:44:43 +03:00
|
|
|
use self::keys::Key;
|
2017-09-13 20:26:39 -07:00
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
mod values;
|
|
|
|
use self::values::Value;
|
2017-09-13 20:26:39 -07:00
|
|
|
|
2020-02-08 07:38:00 +01:00
|
|
|
mod caches;
|
|
|
|
use self::caches::CacheSelector;
|
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
mod config;
|
2018-12-03 01:14:35 +01:00
|
|
|
use self::config::QueryAccessors;
|
2019-12-22 17:42:04 -05:00
|
|
|
pub use self::config::QueryConfig;
|
|
|
|
pub(crate) use self::config::QueryDescription;
|
2017-04-28 09:40:48 -04:00
|
|
|
|
2017-10-19 14:32:39 +02:00
|
|
|
mod on_disk_cache;
|
|
|
|
pub use self::on_disk_cache::OnDiskCache;
|
|
|
|
|
2019-12-17 14:44:07 +01:00
|
|
|
mod profiling_support;
|
|
|
|
pub use self::profiling_support::{IntoSelfProfilingString, QueryKeyStringBuilder};
|
|
|
|
|
2018-12-03 01:14:35 +01:00
|
|
|
// Each of these queries corresponds to a function pointer field in the
|
2018-06-13 16:44:43 +03:00
|
|
|
// `Providers` struct for requesting a value of that type, and a method
|
|
|
|
// on `tcx: TyCtxt` (and `tcx.at(span)`) for doing that request in a way
|
|
|
|
// which memoizes and does dep-graph tracking, wrapping around the actual
|
|
|
|
// `Providers` that the driver creates (using several `rustc_*` crates).
|
2018-01-31 16:08:14 +01:00
|
|
|
//
|
2018-06-13 16:44:43 +03:00
|
|
|
// The result type of each query must implement `Clone`, and additionally
|
|
|
|
// `ty::query::values::Value`, which produces an appropriate placeholder
|
|
|
|
// (error) value if the query resulted in a query cycle.
|
|
|
|
// Queries marked with `fatal_cycle` do not need the latter implementation,
|
2018-01-31 16:08:14 +01:00
|
|
|
// as they will raise an fatal error on query cycles instead.
|
2018-12-03 01:14:35 +01:00
|
|
|
|
|
|
|
rustc_query_append! { [define_queries!][ <'tcx>
|
2018-05-19 13:50:58 -04:00
|
|
|
Other {
|
2019-04-29 03:54:03 +01:00
|
|
|
/// Runs analysis passes on the crate.
|
2019-06-25 01:41:16 +02:00
|
|
|
[eval_always] fn analysis: Analysis(CrateNum) -> Result<(), ErrorReported>,
|
2018-05-19 13:50:58 -04:00
|
|
|
},
|
2018-12-03 01:14:35 +01:00
|
|
|
]}
|