Module rustc_typeck::collect [−][src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
"Collection" is the process of determining the type and other external details of each item in Rust. Collection is specifically concerned with interprocedural things -- for example, for a function definition, collection will figure out the type and signature of the function, but it will not visit the body of the function in any way, nor examine type annotations on local variables (that's the job of type checking).
Collecting is ultimately defined by a bundle of queries that
inquire after various facts about the items in the crate (e.g.,
type_of
, generics_of
, predicates_of
, etc). See the provide
function
for the full set.
At present, however, we do run collection across all items in the crate as a kind of pass. This should eventually be factored away.
Re-exports
use astconv::AstConv; |
use astconv::Bounds; |
use lint; |
use constrained_type_params as ctp; |
use middle::lang_items::SizedTraitLangItem; |
use middle::resolve_lifetime as rl; |
use rustc::mir::mono::Linkage; |
use rustc::ty::subst::Substs; |
use rustc::ty::ToPredicate; |
use rustc::ty::ReprOptions; |
use rustc::ty; |
use rustc::ty::AdtKind; |
use rustc::ty::ToPolyTraitRef; |
use rustc::ty::Ty; |
use rustc::ty::TyCtxt; |
use rustc::ty::maps::Providers; |
use rustc::ty::util::IntTypeExt; |
use rustc::ty::util::Discr; |
use rustc::util::captures::Captures; |
use rustc::util::nodemap::FxHashMap; |
use rustc_target::spec::abi; |
use syntax::ast; |
use syntax::ast::MetaItemKind; |
use syntax::attr::InlineAttr; |
use syntax::attr::list_contains_name; |
use syntax::attr::mark_used; |
use syntax::codemap::Spanned; |
use syntax::symbol::Symbol; |
use syntax::symbol::keywords; |
use syntax::feature_gate; |
use syntax_pos::Span; |
use syntax_pos::DUMMY_SP; |
use rustc::hir; |
use rustc::hir::map as hir_map; |
use rustc::hir::TransFnAttrs; |
use rustc::hir::TransFnAttrFlags; |
use rustc::hir::Unsafety; |
use rustc::hir::intravisit; |
use rustc::hir::intravisit::Visitor; |
use rustc::hir::intravisit::NestedVisitorMap; |
use rustc::hir::def::Def; |
use rustc::hir::def::CtorKind; |
use rustc::hir::def_id::DefId; |
use rustc::hir::def_id::LOCAL_CRATE; |
Structs
CollectItemTypesVisitor |
[ Experimental ]
|
ItemCtxt |
[ Experimental ] Context specific to some particular item. This is what implements
AstConv. It has information about the predicates that are defined
on the trait. Unfortunately, this predicate information is
available in various different forms at various points in the
process. So we can't just store a pointer to e.g. the AST or the
parsed ty form, we have to be more flexible. To this end, the
|
Enums
SizedByDefault |
[ Experimental ]
|
Functions
adt_def |
[ Experimental ]
|
collect_item_types |
[ Experimental ]
|
compute_bounds |
[ Experimental ] Translate the AST's notion of ty param bounds (which are an enum consisting of a newtyped Ty or a region) to ty's notion of ty param bounds, which can either be user-defined traits, or the built-in trait (formerly known as kind): Send. |
compute_sig_of_foreign_fn_decl |
[ Experimental ]
|
convert_enum_variant_types |
[ Experimental ]
|
convert_impl_item |
[ Experimental ]
|
convert_item |
[ Experimental ]
|
convert_struct_variant |
[ Experimental ]
|
convert_trait_item |
[ Experimental ]
|
convert_variant_ctor |
[ Experimental ]
|
early_bound_lifetimes_from_generics |
[ Experimental ] Returns the early-bound lifetimes declared in this generics
listing. For anything other than fns/methods, this is just all
the lifetimes that are declared. For fns or methods, we have to
screen out those that do not appear in any where-clauses etc using
|
explicit_predicates_of |
[ Experimental ]
|
fn_sig |
[ Experimental ]
|
from_target_feature |
[ Experimental ]
|
generics_of |
[ Experimental ]
|
has_late_bound_regions |
[ Experimental ]
|
impl_polarity |
[ Experimental ]
|
impl_trait_ref |
[ Experimental ]
|
is_foreign_item |
[ Experimental ]
|
is_param |
[ Experimental ] Tests whether this is the AST for a reference to the type
parameter with id |
is_unsized |
[ Experimental ]
|
linkage_by_name |
[ Experimental ]
|
predicates_from_bound |
[ Experimental ] Converts a specific TyParamBound from the AST into a set of
predicates that apply to the self-type. A vector is returned
because this can be anywhere from 0 predicates ( |
predicates_of |
[ Experimental ]
|
provide |
[ Experimental ]
|
super_predicates_of |
[ Experimental ] Ensures that the super-predicates of the trait with def-id trait_def_id are converted and stored. This also ensures that the transitive super-predicates are converted; |
trait_def |
[ Experimental ]
|
trans_fn_attrs |
[ Experimental ]
|
type_of |
[ Experimental ]
|
type_param_predicates |
[ Experimental ]
|