2019-03-29 02:50:31 +01:00
|
|
|
use crate::dep_graph::{self, DepNode};
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::hir::def_id::{CrateNum, DefId, DefIndex};
|
2019-04-20 19:46:19 +03:00
|
|
|
use crate::hir::def::{DefKind, Export};
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::hir::{self, TraitCandidate, ItemLocalId, CodegenFnAttrs};
|
|
|
|
use crate::infer::canonical::{self, Canonical};
|
|
|
|
use crate::lint;
|
|
|
|
use crate::middle::cstore::{ExternCrate, LinkagePreference, NativeLibrary, ForeignModule};
|
|
|
|
use crate::middle::cstore::{NativeLibraryKind, DepKind, CrateSource};
|
|
|
|
use crate::middle::privacy::AccessLevels;
|
|
|
|
use crate::middle::reachable::ReachableSet;
|
|
|
|
use crate::middle::region;
|
|
|
|
use crate::middle::resolve_lifetime::{ResolveLifetimes, Region, ObjectLifetimeDefault};
|
|
|
|
use crate::middle::stability::{self, DeprecationEntry};
|
|
|
|
use crate::middle::lib_features::LibFeatures;
|
|
|
|
use crate::middle::lang_items::{LanguageItems, LangItem};
|
|
|
|
use crate::middle::exported_symbols::{SymbolExportLevel, ExportedSymbol};
|
|
|
|
use crate::mir::interpret::{ConstEvalRawResult, ConstEvalResult};
|
|
|
|
use crate::mir::mono::CodegenUnit;
|
|
|
|
use crate::mir;
|
|
|
|
use crate::mir::interpret::GlobalId;
|
2018-12-08 20:30:23 +01:00
|
|
|
use crate::session::CrateDisambiguator;
|
2019-01-29 07:24:32 +02:00
|
|
|
use crate::session::config::{EntryFnType, OutputFilenames, OptLevel, SymbolManglingVersion};
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::traits::{self, Vtable};
|
|
|
|
use crate::traits::query::{
|
2018-10-23 20:31:57 -04:00
|
|
|
CanonicalPredicateGoal, CanonicalProjectionGoal,
|
2018-11-22 20:35:24 +01:00
|
|
|
CanonicalTyGoal, CanonicalTypeOpAscribeUserTypeGoal,
|
2018-12-18 21:27:22 +01:00
|
|
|
CanonicalTypeOpEqGoal, CanonicalTypeOpSubtypeGoal, CanonicalTypeOpProvePredicateGoal,
|
2018-10-23 20:31:57 -04:00
|
|
|
CanonicalTypeOpNormalizeGoal, NoSolution,
|
|
|
|
};
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::traits::query::method_autoderef::MethodAutoderefStepsResult;
|
|
|
|
use crate::traits::query::dropck_outlives::{DtorckConstraint, DropckOutlivesResult};
|
|
|
|
use crate::traits::query::normalize::NormalizationResult;
|
|
|
|
use crate::traits::query::outlives_bounds::OutlivesBound;
|
|
|
|
use crate::traits::specialization_graph;
|
|
|
|
use crate::traits::Clauses;
|
2019-01-24 20:05:19 +01:00
|
|
|
use crate::ty::{self, CrateInherentImpls, ParamEnvAnd, Ty, TyCtxt, AdtSizedConstraint};
|
2019-02-05 11:20:45 -06:00
|
|
|
use crate::ty::steal::Steal;
|
2019-01-24 20:05:19 +01:00
|
|
|
use crate::ty::util::NeedsDrop;
|
2019-02-09 22:11:53 +08:00
|
|
|
use crate::ty::subst::SubstsRef;
|
2019-09-28 15:59:19 +01:00
|
|
|
use crate::util::nodemap::{DefIdSet, DefIdMap};
|
2019-09-26 05:30:10 +00:00
|
|
|
use crate::util::common::ErrorReported;
|
2019-11-11 17:15:36 -05:00
|
|
|
use rustc_data_structures::profiling::ProfileCategory::*;
|
2016-10-28 13:55:49 +03:00
|
|
|
|
2019-02-09 11:24:02 +09:00
|
|
|
use rustc_data_structures::svh::Svh;
|
2019-09-26 05:38:33 +00:00
|
|
|
use rustc_index::vec::IndexVec;
|
2019-05-14 19:42:57 +03:00
|
|
|
use rustc_data_structures::fx::{FxIndexMap, FxHashMap, FxHashSet};
|
2017-09-14 17:40:37 +02:00
|
|
|
use rustc_data_structures::stable_hasher::StableVec;
|
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;
|
2019-01-20 05:44:02 +01:00
|
|
|
use rustc_data_structures::fingerprint::Fingerprint;
|
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
|
|
|
|
2018-10-01 15:31:27 +02:00
|
|
|
use std::borrow::Cow;
|
2017-04-24 18:06:39 +03:00
|
|
|
use std::ops::Deref;
|
2017-09-12 09:32:37 -07:00
|
|
|
use std::sync::Arc;
|
2019-04-17 19:38:17 -07:00
|
|
|
use std::any::type_name;
|
2017-02-14 11:32:00 +02:00
|
|
|
use syntax_pos::{Span, DUMMY_SP};
|
2017-05-02 06:53:34 -05:00
|
|
|
use syntax::attr;
|
2017-05-03 08:40:32 -05:00
|
|
|
use syntax::ast;
|
2017-04-24 19:35:47 +03:00
|
|
|
use syntax::symbol::Symbol;
|
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
|
|
|
|
2018-03-15 10:03:36 +01:00
|
|
|
mod job;
|
2018-03-24 06:19:20 +01:00
|
|
|
pub use self::job::{QueryJob, QueryInfo};
|
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;
|
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
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
mod config;
|
2018-12-03 01:14:35 +01:00
|
|
|
pub(crate) use self::config::QueryDescription;
|
2017-09-18 05:40:13 -04:00
|
|
|
pub use self::config::QueryConfig;
|
2018-12-03 01:14:35 +01:00
|
|
|
use self::config::QueryAccessors;
|
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;
|
|
|
|
|
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
|
|
|
]}
|