[−][src]Struct rustc_typeck::check::regionck::RegionCtxt
🔬 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?
Fields
fcx: &'a FnCtxt<'a, 'gcx, 'tcx>
🔬 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?
region_scope_tree: Lrc<ScopeTree>
🔬 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?
outlives_environment: OutlivesEnvironment<'tcx>
🔬 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?
body_id: NodeId
🔬 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?
call_site_scope: Option<Scope>
🔬 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?
repeating_scope: NodeId
🔬 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?
subject_def_id: DefId
🔬 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?
Methods
impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx>
pub fn new(
fcx: &'a FnCtxt<'a, 'gcx, 'tcx>,
RepeatingScope: RepeatingScope,
initial_body_id: NodeId,
Subject: Subject,
param_env: ParamEnv<'tcx>
) -> RegionCtxt<'a, 'gcx, 'tcx>
[src]
pub fn new(
fcx: &'a FnCtxt<'a, 'gcx, 'tcx>,
RepeatingScope: RepeatingScope,
initial_body_id: NodeId,
Subject: Subject,
param_env: ParamEnv<'tcx>
) -> RegionCtxt<'a, 'gcx, 'tcx>
🔬 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?
fn set_repeating_scope(&mut self, scope: NodeId) -> NodeId
[src]
fn set_repeating_scope(&mut self, scope: NodeId) -> NodeId
🔬 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?
pub fn resolve_type(&self, unresolved_ty: Ty<'tcx>) -> Ty<'tcx>
[src]
pub fn resolve_type(&self, unresolved_ty: Ty<'tcx>) -> Ty<'tcx>
🔬 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?
Try to resolve the type for the given node, returning t_err if an error results. Note that we never care about the details of the error, the same error will be detected and reported in the writeback phase.
Note one important point: we do not attempt to resolve region variables here. This is because regionck is essentially adding constraints to those region variables and so may yet influence how they are resolved.
Consider this silly example:
fn borrow(x: &i32) -> &i32 {x} fn foo(x: @i32) -> i32 { // block: B let b = borrow(x); // region: <R0> *b }
Here, the region of b
will be <R0>
. <R0>
is constrained to be some subregion of the
block B and some superregion of the call. If we forced it now, we'd choose the smaller
region (the call). But that would make the *b illegal. Since we don't resolve, the type
of b will be &<R0>.i32
and then *b
will require that <R0>
be bigger than the let and
the *b
expression, so we will effectively resolve <R0>
to be the block B.
fn resolve_node_type(&self, id: HirId) -> Ty<'tcx>
[src]
fn resolve_node_type(&self, id: HirId) -> Ty<'tcx>
🔬 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?
Try to resolve the type for the given node.
pub fn resolve_expr_type_adjusted(&mut self, expr: &Expr) -> Ty<'tcx>
[src]
pub fn resolve_expr_type_adjusted(&mut self, expr: &Expr) -> Ty<'tcx>
🔬 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?
Try to resolve the type for the given node.
fn visit_fn_body(&mut self, id: NodeId, body: &'gcx Body, span: Span)
[src]
fn visit_fn_body(&mut self, id: NodeId, body: &'gcx Body, span: Span)
🔬 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?
This is the "main" function when region-checking a function item or a closure
within a function item. It begins by updating various fields (e.g., call_site_scope
and outlives_environment
) to be appropriate to the function and then adds constraints
derived from the function body.
Note that it does not restore the state of the fields that
it updates! This is intentional, since -- for the main
function -- we wish to be able to read the final
outlives_environment
and other fields from the caller. For
closures, however, we save and restore any "scoped state"
before we invoke this function. (See visit_fn
in the
intravisit::Visitor
impl below.)
fn visit_region_obligations(&mut self, node_id: NodeId)
[src]
fn visit_region_obligations(&mut self, node_id: NodeId)
🔬 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?
fn resolve_regions_and_report_errors(&self)
[src]
fn resolve_regions_and_report_errors(&self)
🔬 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?
fn resolve_regions_and_report_errors_unless_nll(&self)
[src]
fn resolve_regions_and_report_errors_unless_nll(&self)
🔬 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?
fn constrain_bindings_in_pat(&mut self, pat: &Pat)
[src]
fn constrain_bindings_in_pat(&mut self, pat: &Pat)
🔬 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?
impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx>
fn constrain_cast(&mut self, cast_expr: &Expr, source_expr: &Expr)
[src]
fn constrain_cast(&mut self, cast_expr: &Expr, source_expr: &Expr)
🔬 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?
fn walk_cast(&mut self, cast_expr: &Expr, from_ty: Ty<'tcx>, to_ty: Ty<'tcx>)
[src]
fn walk_cast(&mut self, cast_expr: &Expr, from_ty: Ty<'tcx>, to_ty: Ty<'tcx>)
🔬 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?
fn check_expr_fn_block(&mut self, expr: &'gcx Expr, body_id: BodyId)
[src]
fn check_expr_fn_block(&mut self, expr: &'gcx Expr, body_id: BodyId)
🔬 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?
fn constrain_callee(&mut self, callee_expr: &Expr)
[src]
fn constrain_callee(&mut self, callee_expr: &Expr)
🔬 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?
fn constrain_call<'b, I: Iterator<Item = &'b Expr>>(
&mut self,
call_expr: &Expr,
receiver: Option<&Expr>,
arg_exprs: I
)
[src]
fn constrain_call<'b, I: Iterator<Item = &'b Expr>>(
&mut self,
call_expr: &Expr,
receiver: Option<&Expr>,
arg_exprs: I
)
🔬 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?
Invoked on every call site (i.e., normal calls, method calls, and overloaded operators). Constrains the regions which appear in the type of the function. Also constrains the regions that appear in the arguments appropriately.
fn with_mc<F, R>(&self, f: F) -> R where
F: for<'b> FnOnce(MemCategorizationContext<'b, 'gcx, 'tcx>) -> R,
[src]
fn with_mc<F, R>(&self, f: F) -> R where
F: for<'b> FnOnce(MemCategorizationContext<'b, 'gcx, 'tcx>) -> R,
🔬 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?
Create a temporary MemCategorizationContext
and pass it to the closure.
fn constrain_adjustments(&mut self, expr: &Expr) -> McResult<cmt_<'tcx>>
[src]
fn constrain_adjustments(&mut self, expr: &Expr) -> McResult<cmt_<'tcx>>
🔬 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?
Invoked on any adjustments that occur. Checks that if this is a region pointer being dereferenced, the lifetime of the pointer includes the deref expr.
pub fn mk_subregion_due_to_dereference(
&mut self,
deref_span: Span,
minimum_lifetime: Region<'tcx>,
maximum_lifetime: Region<'tcx>
)
[src]
pub fn mk_subregion_due_to_dereference(
&mut self,
deref_span: Span,
minimum_lifetime: Region<'tcx>,
maximum_lifetime: Region<'tcx>
)
🔬 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?
fn check_safety_of_rvalue_destructor_if_necessary(
&mut self,
cmt: &cmt_<'tcx>,
span: Span
)
[src]
fn check_safety_of_rvalue_destructor_if_necessary(
&mut self,
cmt: &cmt_<'tcx>,
span: Span
)
🔬 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?
fn constrain_index(&mut self, index_expr: &Expr, indexed_ty: Ty<'tcx>)
[src]
fn constrain_index(&mut self, index_expr: &Expr, indexed_ty: Ty<'tcx>)
🔬 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?
Invoked on any index expression that occurs. Checks that if this is a slice being indexed, the lifetime of the pointer includes the deref expr.
fn type_of_node_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
hir_id: HirId,
minimum_lifetime: Region<'tcx>
)
[src]
fn type_of_node_must_outlive(
&mut self,
origin: SubregionOrigin<'tcx>,
hir_id: HirId,
minimum_lifetime: Region<'tcx>
)
🔬 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?
Guarantees that any lifetimes which appear in the type of the node id
(after applying
adjustments) are valid for at least minimum_lifetime
pub fn type_must_outlive(
&self,
origin: SubregionOrigin<'tcx>,
ty: Ty<'tcx>,
region: Region<'tcx>
)
[src]
pub fn type_must_outlive(
&self,
origin: SubregionOrigin<'tcx>,
ty: Ty<'tcx>,
region: Region<'tcx>
)
🔬 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?
Adds constraints to inference such that T: 'a
holds (or
reports an error if it cannot).
Parameters
origin
, the reason we need this constraintty
, the typeT
region
, the region'a
fn link_addr_of(&mut self, expr: &Expr, mutability: Mutability, base: &Expr)
[src]
fn link_addr_of(&mut self, expr: &Expr, mutability: Mutability, base: &Expr)
🔬 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?
Computes the guarantor for an expression &base
and then ensures that the lifetime of the
resulting pointer is linked to the lifetime of its guarantor (if any).
fn link_local(&self, local: &Local)
[src]
fn link_local(&self, local: &Local)
🔬 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?
Computes the guarantors for any ref bindings in a let
and
then ensures that the lifetime of the resulting pointer is
linked to the lifetime of the initialization expression.
fn link_match(&self, discr: &Expr, arms: &[Arm])
[src]
fn link_match(&self, discr: &Expr, arms: &[Arm])
🔬 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?
Computes the guarantors for any ref bindings in a match and then ensures that the lifetime of the resulting pointer is linked to the lifetime of its guarantor (if any).
fn link_fn_args(&self, body_scope: Scope, args: &[Arg])
[src]
fn link_fn_args(&self, body_scope: Scope, args: &[Arg])
🔬 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?
Computes the guarantors for any ref bindings in a match and then ensures that the lifetime of the resulting pointer is linked to the lifetime of its guarantor (if any).
fn link_pattern(&self, discr_cmt: cmt<'tcx>, root_pat: &Pat)
[src]
fn link_pattern(&self, discr_cmt: cmt<'tcx>, root_pat: &Pat)
🔬 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?
Link lifetimes of any ref bindings in root_pat
to the pointers found
in the discriminant, if needed.
fn link_autoref(
&self,
expr: &Expr,
expr_cmt: &cmt_<'tcx>,
autoref: &AutoBorrow<'tcx>
)
[src]
fn link_autoref(
&self,
expr: &Expr,
expr_cmt: &cmt_<'tcx>,
autoref: &AutoBorrow<'tcx>
)
🔬 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?
Link lifetime of borrowed pointer resulting from autoref to lifetimes in the value being autoref'd.
fn link_region_from_node_type(
&self,
span: Span,
id: HirId,
mutbl: Mutability,
cmt_borrowed: &cmt_<'tcx>
)
[src]
fn link_region_from_node_type(
&self,
span: Span,
id: HirId,
mutbl: Mutability,
cmt_borrowed: &cmt_<'tcx>
)
🔬 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?
Like link_region()
, except that the region is extracted from the type of id
,
which must be some reference (&T
, &str
, etc).
fn link_region(
&self,
span: Span,
borrow_region: Region<'tcx>,
borrow_kind: BorrowKind,
borrow_cmt: &cmt_<'tcx>
)
[src]
fn link_region(
&self,
span: Span,
borrow_region: Region<'tcx>,
borrow_kind: BorrowKind,
borrow_cmt: &cmt_<'tcx>
)
🔬 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?
Informs the inference engine that borrow_cmt
is being borrowed with
kind borrow_kind
and lifetime borrow_region
.
In order to ensure borrowck is satisfied, this may create constraints
between regions, as explained in link_reborrowed_region()
.
fn link_reborrowed_region(
&self,
span: Span,
borrow_region: Region<'tcx>,
borrow_kind: BorrowKind,
ref_cmt: cmt<'tcx>,
ref_region: Region<'tcx>,
ref_kind: BorrowKind,
note: Note
) -> Option<(cmt<'tcx>, BorrowKind)>
[src]
fn link_reborrowed_region(
&self,
span: Span,
borrow_region: Region<'tcx>,
borrow_kind: BorrowKind,
ref_cmt: cmt<'tcx>,
ref_region: Region<'tcx>,
ref_kind: BorrowKind,
note: Note
) -> Option<(cmt<'tcx>, BorrowKind)>
🔬 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?
This is the most complicated case: the path being borrowed is itself the referent of a borrowed pointer. Let me give an example fragment of code to make clear(er) the situation:
let r: &'a mut T = ...; // the original reference "r" has lifetime 'a ... &'z *r // the reborrow has lifetime 'z
Now, in this case, our primary job is to add the inference
constraint that 'z <= 'a
. Given this setup, let's clarify the
parameters in (roughly) terms of the example:
A borrow of: `& 'z bk * r` where `r` has type `& 'a bk T`
borrow_region ^~ ref_region ^~
borrow_kind ^~ ref_kind ^~
ref_cmt ^
Here bk
stands for some borrow-kind (e.g., mut
, uniq
, etc).
Unfortunately, there are some complications beyond the simple scenario I just painted:
-
The reference
r
might in fact be a "by-ref" upvar. In that case, we have two jobs. First, we are inferring whether this reference should be an&T
,&mut T
, or&uniq T
reference, and we must adjust that based on this borrow (e.g., if this is an&mut
borrow, thenr
must be an&mut
reference). Second, whenever we link two regions (here,'z <= 'a
), we supply a cause, and in this case we adjust the cause to indicate that the reference being "reborrowed" is itself an upvar. This provides a nicer error message should something go wrong. -
There may in fact be more levels of reborrowing. In the example, I said the borrow was like
&'z *r
, but it might in fact be a borrow like&'z **q
whereq
has type&'a &'b mut T
. In that case, we want to ensure that'z <= 'a
and'z <= 'b
. This is explained more below.
The return value of this function indicates whether we need to
recurse and process ref_cmt
(see case 2 above).
fn substs_wf_in_scope(
&mut self,
origin: ParameterOrigin,
substs: &Substs<'tcx>,
expr_span: Span,
expr_region: Region<'tcx>
)
[src]
fn substs_wf_in_scope(
&mut self,
origin: ParameterOrigin,
substs: &Substs<'tcx>,
expr_span: Span,
expr_region: Region<'tcx>
)
🔬 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?
Checks that the values provided for type/region arguments in a given expression are well-formed and in-scope.
Methods from Deref<Target = FnCtxt<'a, 'gcx, 'tcx>>
ⓘImportant traits for Autoderef<'a, 'gcx, 'tcx>pub fn autoderef(
&'a self,
span: Span,
base_ty: Ty<'tcx>
) -> Autoderef<'a, 'gcx, 'tcx>
[src]
pub fn autoderef(
&'a self,
span: Span,
base_ty: Ty<'tcx>
) -> Autoderef<'a, 'gcx, 'tcx>
🔬 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?
pub fn try_overloaded_deref(
&self,
span: Span,
base_ty: Ty<'tcx>,
needs: Needs
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>>
[src]
pub fn try_overloaded_deref(
&self,
span: Span,
base_ty: Ty<'tcx>,
needs: Needs
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>>
🔬 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?
pub fn check_pat_walk(
&self,
pat: &'gcx Pat,
expected: Ty<'tcx>,
def_bm: BindingMode,
is_arg: bool
)
[src]
pub fn check_pat_walk(
&self,
pat: &'gcx Pat,
expected: Ty<'tcx>,
def_bm: BindingMode,
is_arg: bool
)
🔬 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?
The is_arg
argument indicates whether this pattern is the
outermost pattern in an argument (e.g., in fn foo(&x: &u32)
, it is true for the &x
pattern but not x
). This is
used to tailor error reporting.
pub fn check_dereferencable(
&self,
span: Span,
expected: Ty<'tcx>,
inner: &Pat
) -> bool
[src]
pub fn check_dereferencable(
&self,
span: Span,
expected: Ty<'tcx>,
inner: &Pat
) -> bool
🔬 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?
pub fn check_match(
&self,
expr: &'gcx Expr,
discrim: &'gcx Expr,
arms: &'gcx [Arm],
expected: Expectation<'tcx>,
match_src: MatchSource
) -> Ty<'tcx>
[src]
pub fn check_match(
&self,
expr: &'gcx Expr,
discrim: &'gcx Expr,
arms: &'gcx [Arm],
expected: Expectation<'tcx>,
match_src: MatchSource
) -> Ty<'tcx>
🔬 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?
fn check_pat_struct(
&self,
pat: &'gcx Pat,
qpath: &QPath,
fields: &'gcx [Spanned<FieldPat>],
etc: bool,
expected: Ty<'tcx>,
def_bm: BindingMode
) -> Ty<'tcx>
[src]
fn check_pat_struct(
&self,
pat: &'gcx Pat,
qpath: &QPath,
fields: &'gcx [Spanned<FieldPat>],
etc: bool,
expected: Ty<'tcx>,
def_bm: BindingMode
) -> Ty<'tcx>
🔬 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?
fn check_pat_path(
&self,
pat: &Pat,
qpath: &QPath,
expected: Ty<'tcx>
) -> Ty<'tcx>
[src]
fn check_pat_path(
&self,
pat: &Pat,
qpath: &QPath,
expected: Ty<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_pat_tuple_struct(
&self,
pat: &Pat,
qpath: &QPath,
subpats: &'gcx [P<Pat>],
ddpos: Option<usize>,
expected: Ty<'tcx>,
def_bm: BindingMode
) -> Ty<'tcx>
[src]
fn check_pat_tuple_struct(
&self,
pat: &Pat,
qpath: &QPath,
subpats: &'gcx [P<Pat>],
ddpos: Option<usize>,
expected: Ty<'tcx>,
def_bm: BindingMode
) -> Ty<'tcx>
🔬 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?
fn check_struct_pat_fields(
&self,
adt_ty: Ty<'tcx>,
pat_id: NodeId,
span: Span,
variant: &'tcx VariantDef,
fields: &'gcx [Spanned<FieldPat>],
etc: bool,
def_bm: BindingMode
) -> bool
[src]
fn check_struct_pat_fields(
&self,
adt_ty: Ty<'tcx>,
pat_id: NodeId,
span: Span,
variant: &'tcx VariantDef,
fields: &'gcx [Spanned<FieldPat>],
etc: bool,
def_bm: BindingMode
) -> bool
🔬 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?
pub fn resolve_type_vars_in_body(
&self,
body: &'gcx Body
) -> &'gcx TypeckTables<'gcx>
[src]
pub fn resolve_type_vars_in_body(
&self,
body: &'gcx Body
) -> &'gcx TypeckTables<'gcx>
🔬 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?
pub fn regionck_expr(&self, body: &'gcx Body)
[src]
pub fn regionck_expr(&self, body: &'gcx Body)
🔬 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?
pub fn regionck_item(&self, item_id: NodeId, span: Span, wf_tys: &[Ty<'tcx>])
[src]
pub fn regionck_item(&self, item_id: NodeId, span: Span, wf_tys: &[Ty<'tcx>])
🔬 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?
Region checking during the WF phase for items. wf_tys
are the
types from which we should derive implied bounds, if any.
pub fn regionck_fn(&self, fn_id: NodeId, body: &'gcx Body)
[src]
pub fn regionck_fn(&self, fn_id: NodeId, body: &'gcx Body)
🔬 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?
Region check a function body. Not invoked on closures, but only on the "root" fn item (in which closures may be embedded). Walks the function body and adds various add'l constraints that are needed for region inference. This is separated both to isolate "pure" region constraints from the rest of type check and because sometimes we need type inference to have completed before we can determine which constraints to add.
pub fn try_coerce(
&self,
expr: &Expr,
expr_ty: Ty<'tcx>,
target: Ty<'tcx>,
allow_two_phase: AllowTwoPhase
) -> RelateResult<'tcx, Ty<'tcx>>
[src]
pub fn try_coerce(
&self,
expr: &Expr,
expr_ty: Ty<'tcx>,
target: Ty<'tcx>,
allow_two_phase: AllowTwoPhase
) -> RelateResult<'tcx, Ty<'tcx>>
🔬 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?
Attempt to coerce an expression to a type, and return the adjusted type of the expression, if successful. Adjustments are only recorded if the coercion succeeded. The expressions must not have any pre-existing adjustments.
pub fn can_coerce(&self, expr_ty: Ty<'tcx>, target: Ty<'tcx>) -> bool
[src]
pub fn can_coerce(&self, expr_ty: Ty<'tcx>, target: Ty<'tcx>) -> bool
🔬 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?
Same as try_coerce()
, but without side-effects.
fn try_find_coercion_lub<E>(
&self,
cause: &ObligationCause<'tcx>,
exprs: &[E],
prev_ty: Ty<'tcx>,
new: &Expr,
new_ty: Ty<'tcx>
) -> RelateResult<'tcx, Ty<'tcx>> where
E: AsCoercionSite,
[src]
fn try_find_coercion_lub<E>(
&self,
cause: &ObligationCause<'tcx>,
exprs: &[E],
prev_ty: Ty<'tcx>,
new: &Expr,
new_ty: Ty<'tcx>
) -> RelateResult<'tcx, Ty<'tcx>> where
E: AsCoercionSite,
🔬 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?
Given some expressions, their known unified type and another expression, tries to unify the types, potentially inserting coercions on any of the provided expressions and returns their LUB (aka "common supertype").
This is really an internal helper. From outside the coercion
module, you should instantiate a CoerceMany
instance.
pub fn demand_suptype(&self, sp: Span, expected: Ty<'tcx>, actual: Ty<'tcx>)
[src]
pub fn demand_suptype(&self, sp: Span, expected: Ty<'tcx>, actual: Ty<'tcx>)
🔬 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?
pub fn demand_suptype_diag(
&self,
sp: Span,
expected: Ty<'tcx>,
actual: Ty<'tcx>
) -> Option<DiagnosticBuilder<'tcx>>
[src]
pub fn demand_suptype_diag(
&self,
sp: Span,
expected: Ty<'tcx>,
actual: Ty<'tcx>
) -> Option<DiagnosticBuilder<'tcx>>
🔬 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?
pub fn demand_eqtype(&self, sp: Span, expected: Ty<'tcx>, actual: Ty<'tcx>)
[src]
pub fn demand_eqtype(&self, sp: Span, expected: Ty<'tcx>, actual: Ty<'tcx>)
🔬 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?
pub fn demand_eqtype_diag(
&self,
sp: Span,
expected: Ty<'tcx>,
actual: Ty<'tcx>
) -> Option<DiagnosticBuilder<'tcx>>
[src]
pub fn demand_eqtype_diag(
&self,
sp: Span,
expected: Ty<'tcx>,
actual: Ty<'tcx>
) -> Option<DiagnosticBuilder<'tcx>>
🔬 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?
pub fn demand_eqtype_with_origin(
&self,
cause: &ObligationCause<'tcx>,
expected: Ty<'tcx>,
actual: Ty<'tcx>
) -> Option<DiagnosticBuilder<'tcx>>
[src]
pub fn demand_eqtype_with_origin(
&self,
cause: &ObligationCause<'tcx>,
expected: Ty<'tcx>,
actual: Ty<'tcx>
) -> Option<DiagnosticBuilder<'tcx>>
🔬 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?
pub fn demand_coerce(
&self,
expr: &Expr,
checked_ty: Ty<'tcx>,
expected: Ty<'tcx>,
allow_two_phase: AllowTwoPhase
) -> Ty<'tcx>
[src]
pub fn demand_coerce(
&self,
expr: &Expr,
checked_ty: Ty<'tcx>,
expected: Ty<'tcx>,
allow_two_phase: AllowTwoPhase
) -> Ty<'tcx>
🔬 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?
pub fn demand_coerce_diag(
&self,
expr: &Expr,
checked_ty: Ty<'tcx>,
expected: Ty<'tcx>,
allow_two_phase: AllowTwoPhase
) -> (Ty<'tcx>, Option<DiagnosticBuilder<'tcx>>)
[src]
pub fn demand_coerce_diag(
&self,
expr: &Expr,
checked_ty: Ty<'tcx>,
expected: Ty<'tcx>,
allow_two_phase: AllowTwoPhase
) -> (Ty<'tcx>, Option<DiagnosticBuilder<'tcx>>)
🔬 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?
pub fn get_conversion_methods(
&self,
span: Span,
expected: Ty<'tcx>,
checked_ty: Ty<'tcx>
) -> Vec<AssociatedItem>
[src]
pub fn get_conversion_methods(
&self,
span: Span,
expected: Ty<'tcx>,
checked_ty: Ty<'tcx>
) -> Vec<AssociatedItem>
🔬 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?
fn has_no_input_arg(&self, method: &AssociatedItem) -> bool
[src]
fn has_no_input_arg(&self, method: &AssociatedItem) -> bool
🔬 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?
fn can_use_as_ref(&self, expr: &Expr) -> Option<(Span, &'static str, String)>
[src]
fn can_use_as_ref(&self, expr: &Expr) -> Option<(Span, &'static str, String)>
🔬 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?
Identify some cases where as_ref()
would be appropriate and suggest it.
Given the following code:
struct Foo; fn takes_ref(_: &Foo) {} let ref opt = Some(Foo); opt.map(|arg| takes_ref(arg));
Suggest using opt.as_ref().map(|arg| takes_ref(arg));
instead.
It only checks for Option
and Result
and won't work with
opt.map(|arg| { takes_ref(arg) });
pub fn check_ref(
&self,
expr: &Expr,
checked_ty: Ty<'tcx>,
expected: Ty<'tcx>
) -> Option<(Span, &'static str, String)>
[src]
pub fn check_ref(
&self,
expr: &Expr,
checked_ty: Ty<'tcx>,
expected: Ty<'tcx>
) -> Option<(Span, &'static str, String)>
🔬 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?
This function is used to determine potential "simple" improvements or users' errors and provide them useful help. For example:
fn some_fn(s: &str) {} let x = "hey!".to_owned(); some_fn(x); // error
No need to find every potential function which could make a coercion to transform a
String
into a &str
since a &
would do the trick!
In addition of this check, it also checks between references mutability state. If the
expected is mutable but the provided isn't, maybe we could just say "Hey, try with
&mut
!".
pub fn check_for_cast(
&self,
err: &mut DiagnosticBuilder<'tcx>,
expr: &Expr,
checked_ty: Ty<'tcx>,
expected_ty: Ty<'tcx>
) -> bool
[src]
pub fn check_for_cast(
&self,
err: &mut DiagnosticBuilder<'tcx>,
expr: &Expr,
checked_ty: Ty<'tcx>,
expected_ty: Ty<'tcx>
) -> bool
🔬 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?
pub fn confirm_method(
&self,
span: Span,
self_expr: &'gcx Expr,
call_expr: &'gcx Expr,
unadjusted_self_ty: Ty<'tcx>,
pick: Pick<'tcx>,
segment: &PathSegment
) -> ConfirmResult<'tcx>
[src]
pub fn confirm_method(
&self,
span: Span,
self_expr: &'gcx Expr,
call_expr: &'gcx Expr,
unadjusted_self_ty: Ty<'tcx>,
pick: Pick<'tcx>,
segment: &PathSegment
) -> ConfirmResult<'tcx>
🔬 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?
pub fn probe_for_return_type(
&self,
span: Span,
mode: Mode,
return_type: Ty<'tcx>,
self_ty: Ty<'tcx>,
scope_expr_id: NodeId
) -> Vec<AssociatedItem>
[src]
pub fn probe_for_return_type(
&self,
span: Span,
mode: Mode,
return_type: Ty<'tcx>,
self_ty: Ty<'tcx>,
scope_expr_id: NodeId
) -> Vec<AssociatedItem>
🔬 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?
This is used to offer suggestions to users. It returns methods that could have been called which have the desired return type. Some effort is made to rule out methods that, if called, would result in an error (basically, the same criteria we would use to decide if a method is a plausible fit for ambiguity purposes).
pub fn probe_for_name(
&self,
span: Span,
mode: Mode,
item_name: Ident,
is_suggestion: IsSuggestion,
self_ty: Ty<'tcx>,
scope_expr_id: NodeId,
scope: ProbeScope
) -> Result<Pick<'tcx>, MethodError<'tcx>>
[src]
pub fn probe_for_name(
&self,
span: Span,
mode: Mode,
item_name: Ident,
is_suggestion: IsSuggestion,
self_ty: Ty<'tcx>,
scope_expr_id: NodeId,
scope: ProbeScope
) -> Result<Pick<'tcx>, MethodError<'tcx>>
🔬 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?
fn probe_op<OP, R>(
&'a self,
span: Span,
mode: Mode,
method_name: Option<Ident>,
return_type: Option<Ty<'tcx>>,
is_suggestion: IsSuggestion,
self_ty: Ty<'tcx>,
scope_expr_id: NodeId,
scope: ProbeScope,
op: OP
) -> Result<R, MethodError<'tcx>> where
OP: FnOnce(ProbeContext<'a, 'gcx, 'tcx>) -> Result<R, MethodError<'tcx>>,
[src]
fn probe_op<OP, R>(
&'a self,
span: Span,
mode: Mode,
method_name: Option<Ident>,
return_type: Option<Ty<'tcx>>,
is_suggestion: IsSuggestion,
self_ty: Ty<'tcx>,
scope_expr_id: NodeId,
scope: ProbeScope,
op: OP
) -> Result<R, MethodError<'tcx>> where
OP: FnOnce(ProbeContext<'a, 'gcx, 'tcx>) -> Result<R, MethodError<'tcx>>,
🔬 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?
fn create_steps(
&self,
span: Span,
scope_expr_id: NodeId,
self_ty: Ty<'tcx>,
is_suggestion: IsSuggestion
) -> Option<Vec<CandidateStep<'tcx>>>
[src]
fn create_steps(
&self,
span: Span,
scope_expr_id: NodeId,
self_ty: Ty<'tcx>,
is_suggestion: IsSuggestion
) -> Option<Vec<CandidateStep<'tcx>>>
🔬 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?
fn is_fn_ty(&self, ty: &Ty<'tcx>, span: Span) -> bool
[src]
fn is_fn_ty(&self, ty: &Ty<'tcx>, span: Span) -> bool
🔬 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?
pub fn report_method_error(
&self,
span: Span,
rcvr_ty: Ty<'tcx>,
item_name: Ident,
rcvr_expr: Option<&Expr>,
error: MethodError<'tcx>,
args: Option<&'gcx [Expr]>
)
[src]
pub fn report_method_error(
&self,
span: Span,
rcvr_ty: Ty<'tcx>,
item_name: Ident,
rcvr_expr: Option<&Expr>,
error: MethodError<'tcx>,
args: Option<&'gcx [Expr]>
)
🔬 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?
fn suggest_use_candidates(
&self,
err: &mut DiagnosticBuilder,
msg: String,
candidates: Vec<DefId>
)
[src]
fn suggest_use_candidates(
&self,
err: &mut DiagnosticBuilder,
msg: String,
candidates: Vec<DefId>
)
🔬 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?
fn suggest_valid_traits(
&self,
err: &mut DiagnosticBuilder,
valid_out_of_scope_traits: Vec<DefId>
) -> bool
[src]
fn suggest_valid_traits(
&self,
err: &mut DiagnosticBuilder,
valid_out_of_scope_traits: Vec<DefId>
) -> bool
🔬 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?
fn suggest_traits_to_import(
&self,
err: &mut DiagnosticBuilder,
span: Span,
rcvr_ty: Ty<'tcx>,
item_name: Ident,
rcvr_expr: Option<&Expr>,
valid_out_of_scope_traits: Vec<DefId>
)
[src]
fn suggest_traits_to_import(
&self,
err: &mut DiagnosticBuilder,
span: Span,
rcvr_ty: Ty<'tcx>,
item_name: Ident,
rcvr_expr: Option<&Expr>,
valid_out_of_scope_traits: Vec<DefId>
)
🔬 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?
fn type_derefs_to_local(
&self,
span: Span,
rcvr_ty: Ty<'tcx>,
rcvr_expr: Option<&Expr>
) -> bool
[src]
fn type_derefs_to_local(
&self,
span: Span,
rcvr_ty: Ty<'tcx>,
rcvr_expr: Option<&Expr>
) -> bool
🔬 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?
Checks whether there is a local type somewhere in the chain of
autoderefs of rcvr_ty
.
pub fn method_exists(
&self,
method_name: Ident,
self_ty: Ty<'tcx>,
call_expr_id: NodeId,
allow_private: bool
) -> bool
[src]
pub fn method_exists(
&self,
method_name: Ident,
self_ty: Ty<'tcx>,
call_expr_id: NodeId,
allow_private: bool
) -> bool
🔬 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?
Determines whether the type self_ty
supports a method name method_name
or not.
pub fn lookup_method(
&self,
self_ty: Ty<'tcx>,
segment: &PathSegment,
span: Span,
call_expr: &'gcx Expr,
self_expr: &'gcx Expr
) -> Result<MethodCallee<'tcx>, MethodError<'tcx>>
[src]
pub fn lookup_method(
&self,
self_ty: Ty<'tcx>,
segment: &PathSegment,
span: Span,
call_expr: &'gcx Expr,
self_expr: &'gcx Expr
) -> Result<MethodCallee<'tcx>, MethodError<'tcx>>
🔬 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?
Performs method lookup. If lookup is successful, it will return the callee
and store an appropriate adjustment for the self-expr. In some cases it may
report an error (e.g., invoking the drop
method).
Arguments
Given a method call like foo.bar::<T1,...Tn>(...)
:
fcx
: the surroundingFnCtxt
(!)span
: the span for the method callmethod_name
: the name of the method being called (bar
)self_ty
: the (unadjusted) type of the self expression (foo
)supplied_method_types
: the explicit method type parameters, if any (T1..Tn
)self_expr
: the self expression (foo
)
fn lookup_probe(
&self,
span: Span,
method_name: Ident,
self_ty: Ty<'tcx>,
call_expr: &'gcx Expr,
scope: ProbeScope
) -> Result<Pick<'tcx>, MethodError<'tcx>>
[src]
fn lookup_probe(
&self,
span: Span,
method_name: Ident,
self_ty: Ty<'tcx>,
call_expr: &'gcx Expr,
scope: ProbeScope
) -> Result<Pick<'tcx>, MethodError<'tcx>>
🔬 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?
pub fn lookup_method_in_trait(
&self,
span: Span,
m_name: Ident,
trait_def_id: DefId,
self_ty: Ty<'tcx>,
opt_input_types: Option<&[Ty<'tcx>]>
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>>
[src]
pub fn lookup_method_in_trait(
&self,
span: Span,
m_name: Ident,
trait_def_id: DefId,
self_ty: Ty<'tcx>,
opt_input_types: Option<&[Ty<'tcx>]>
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>>
🔬 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?
lookup_method_in_trait
is used for overloaded operators.
It does a very narrow slice of what the normal probe/confirm path does.
In particular, it doesn't really do any probing: it simply constructs
an obligation for a particular trait with the given self-type and checks
whether that trait is implemented.
FIXME(#18741) -- It seems likely that we can consolidate some of this code with the other method-lookup code. In particular, the second half of this method is basically the same as confirmation.
pub fn resolve_ufcs(
&self,
span: Span,
method_name: Ident,
self_ty: Ty<'tcx>,
expr_id: NodeId
) -> Result<Def, MethodError<'tcx>>
[src]
pub fn resolve_ufcs(
&self,
span: Span,
method_name: Ident,
self_ty: Ty<'tcx>,
expr_id: NodeId
) -> Result<Def, MethodError<'tcx>>
🔬 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?
pub fn associated_item(
&self,
def_id: DefId,
item_name: Ident,
ns: Namespace
) -> Option<AssociatedItem>
[src]
pub fn associated_item(
&self,
def_id: DefId,
item_name: Ident,
ns: Namespace
) -> Option<AssociatedItem>
🔬 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?
Find item with name item_name
defined in impl/trait def_id
and return it, or None
, if no such item was defined there.
pub fn closure_analyze(&self, body: &'gcx Body)
[src]
pub fn closure_analyze(&self, body: &'gcx Body)
🔬 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?
fn analyze_closure(
&self,
closure_node_id: NodeId,
closure_hir_id: HirId,
span: Span,
body: &Body,
capture_clause: CaptureClause
)
[src]
fn analyze_closure(
&self,
closure_node_id: NodeId,
closure_hir_id: HirId,
span: Span,
body: &Body,
capture_clause: CaptureClause
)
🔬 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?
Analysis starting point.
fn final_upvar_tys(&self, closure_id: NodeId) -> Vec<Ty<'tcx>>
[src]
fn final_upvar_tys(&self, closure_id: NodeId) -> Vec<Ty<'tcx>>
🔬 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?
fn non_enum_variant(&self, struct_def: &VariantData) -> AdtVariant<'tcx>
[src]
fn non_enum_variant(&self, struct_def: &VariantData) -> AdtVariant<'tcx>
🔬 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?
fn enum_variants(&self, enum_def: &EnumDef) -> Vec<AdtVariant<'tcx>>
[src]
fn enum_variants(&self, enum_def: &EnumDef) -> Vec<AdtVariant<'tcx>>
🔬 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?
fn impl_implied_bounds(&self, impl_def_id: DefId, span: Span) -> Vec<Ty<'tcx>>
[src]
fn impl_implied_bounds(&self, impl_def_id: DefId, span: Span) -> Vec<Ty<'tcx>>
🔬 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?
fn pointer_kind(
&self,
t: Ty<'tcx>,
span: Span
) -> Result<Option<PointerKind<'tcx>>, ErrorReported>
[src]
fn pointer_kind(
&self,
t: Ty<'tcx>,
span: Span
) -> Result<Option<PointerKind<'tcx>>, ErrorReported>
🔬 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?
Returns the kind of unsize information of t, or None if t is unknown.
fn type_is_known_to_be_sized(&self, ty: Ty<'tcx>, span: Span) -> bool
[src]
fn type_is_known_to_be_sized(&self, ty: Ty<'tcx>, span: Span) -> bool
🔬 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?
pub fn check_expr_closure(
&self,
expr: &Expr,
_capture: CaptureClause,
decl: &'gcx FnDecl,
body_id: BodyId,
gen: Option<GeneratorMovability>,
expected: Expectation<'tcx>
) -> Ty<'tcx>
[src]
pub fn check_expr_closure(
&self,
expr: &Expr,
_capture: CaptureClause,
decl: &'gcx FnDecl,
body_id: BodyId,
gen: Option<GeneratorMovability>,
expected: Expectation<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_closure(
&self,
expr: &Expr,
opt_kind: Option<ClosureKind>,
decl: &'gcx FnDecl,
body: &'gcx Body,
gen: Option<GeneratorMovability>,
expected_sig: Option<ExpectedSig<'tcx>>
) -> Ty<'tcx>
[src]
fn check_closure(
&self,
expr: &Expr,
opt_kind: Option<ClosureKind>,
decl: &'gcx FnDecl,
body: &'gcx Body,
gen: Option<GeneratorMovability>,
expected_sig: Option<ExpectedSig<'tcx>>
) -> Ty<'tcx>
🔬 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?
fn deduce_expectations_from_expected_type(
&self,
expected_ty: Ty<'tcx>
) -> (Option<ExpectedSig<'tcx>>, Option<ClosureKind>)
[src]
fn deduce_expectations_from_expected_type(
&self,
expected_ty: Ty<'tcx>
) -> (Option<ExpectedSig<'tcx>>, Option<ClosureKind>)
🔬 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?
Given the expected type, figures out what it can about this closure we are about to type check:
fn deduce_expectations_from_obligations(
&self,
expected_vid: TyVid
) -> (Option<ExpectedSig<'tcx>>, Option<ClosureKind>)
[src]
fn deduce_expectations_from_obligations(
&self,
expected_vid: TyVid
) -> (Option<ExpectedSig<'tcx>>, Option<ClosureKind>)
🔬 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?
fn deduce_sig_from_projection(
&self,
cause_span: Option<Span>,
projection: &PolyProjectionPredicate<'tcx>
) -> Option<ExpectedSig<'tcx>>
[src]
fn deduce_sig_from_projection(
&self,
cause_span: Option<Span>,
projection: &PolyProjectionPredicate<'tcx>
) -> Option<ExpectedSig<'tcx>>
🔬 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?
Given a projection like "<F as Fn(X)>::Result == Y", we can deduce everything we need to know about a closure.
The cause_span
should be the span that caused us to
have this expected signature, or None
if we can't readily
know that.
fn self_type_matches_expected_vid(
&self,
trait_ref: PolyTraitRef<'tcx>,
expected_vid: TyVid
) -> Option<PolyTraitRef<'tcx>>
[src]
fn self_type_matches_expected_vid(
&self,
trait_ref: PolyTraitRef<'tcx>,
expected_vid: TyVid
) -> Option<PolyTraitRef<'tcx>>
🔬 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?
fn sig_of_closure(
&self,
expr_def_id: DefId,
decl: &FnDecl,
body: &Body,
expected_sig: Option<ExpectedSig<'tcx>>
) -> ClosureSignatures<'tcx>
[src]
fn sig_of_closure(
&self,
expr_def_id: DefId,
decl: &FnDecl,
body: &Body,
expected_sig: Option<ExpectedSig<'tcx>>
) -> ClosureSignatures<'tcx>
🔬 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?
fn sig_of_closure_no_expectation(
&self,
expr_def_id: DefId,
decl: &FnDecl,
body: &Body
) -> ClosureSignatures<'tcx>
[src]
fn sig_of_closure_no_expectation(
&self,
expr_def_id: DefId,
decl: &FnDecl,
body: &Body
) -> ClosureSignatures<'tcx>
🔬 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?
If there is no expected signature, then we will convert the types that the user gave into a signature.
fn sig_of_closure_with_expectation(
&self,
expr_def_id: DefId,
decl: &FnDecl,
body: &Body,
expected_sig: ExpectedSig<'tcx>
) -> ClosureSignatures<'tcx>
[src]
fn sig_of_closure_with_expectation(
&self,
expr_def_id: DefId,
decl: &FnDecl,
body: &Body,
expected_sig: ExpectedSig<'tcx>
) -> ClosureSignatures<'tcx>
🔬 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?
Invoked to compute the signature of a closure expression. This
combines any user-provided type annotations (e.g., |x: u32| -> u32 { .. }
) with the expected signature.
The approach is as follows:
- Let
S
be the (higher-ranked) signature that we derive from the user's annotations. - Let
E
be the (higher-ranked) signature that we derive from the expectations, if any.- If we have no expectation
E
, then the signature of the closure isS
. - Otherwise, the signature of the closure is E. Moreover:
- Skolemize the late-bound regions in
E
, yieldingE'
. - Instantiate all the late-bound regions bound in the closure within
S
with fresh (existential) variables, yieldingS'
- Require that
E' = S'
- We could use some kind of subtyping relationship here, I imagine, but equality is easier and works fine for our purposes.
- Skolemize the late-bound regions in
- If we have no expectation
The key intuition here is that the user's types must be valid from "the inside" of the closure, but the expectation ultimately drives the overall signature.
Examples
fn with_closure<F>(_: F) where F: Fn(&u32) -> &u32 { .. } with_closure(|x: &u32| { ... })
Here:
- E would be
fn(&u32) -> &u32
. - S would be `fn(&u32) ->
- E' is
&'!0 u32 -> &'!0 u32
- S' is
&'?0 u32 -> ?T
S' can be unified with E' with ['?0 = '!0, ?T = &'!10 u32]
.
Arguments
expr_def_id
: the def-id of the closure expressiondecl
: the HIR declaration of the closurebody
: the body of the closureexpected_sig
: the expected signature (if any). Note that this is missing a binder: that is, there may be late-bound regions with depth 1, which are bound then by the closure.
fn sig_of_closure_with_mismatched_number_of_arguments(
&self,
expr_def_id: DefId,
decl: &FnDecl,
body: &Body,
expected_sig: ExpectedSig<'tcx>
) -> ClosureSignatures<'tcx>
[src]
fn sig_of_closure_with_mismatched_number_of_arguments(
&self,
expr_def_id: DefId,
decl: &FnDecl,
body: &Body,
expected_sig: ExpectedSig<'tcx>
) -> ClosureSignatures<'tcx>
🔬 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?
fn check_supplied_sig_against_expectation(
&self,
decl: &FnDecl,
expected_sigs: &ClosureSignatures<'tcx>
) -> InferResult<'tcx, ()>
[src]
fn check_supplied_sig_against_expectation(
&self,
decl: &FnDecl,
expected_sigs: &ClosureSignatures<'tcx>
) -> InferResult<'tcx, ()>
🔬 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?
Enforce the user's types against the expectation. See
sig_of_closure_with_expectation
for details on the overall
strategy.
fn supplied_sig_of_closure(&self, decl: &FnDecl) -> PolyFnSig<'tcx>
[src]
fn supplied_sig_of_closure(&self, decl: &FnDecl) -> PolyFnSig<'tcx>
🔬 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?
If there is no expected signature, then we will convert the types that the user gave into a signature.
fn error_sig_of_closure(&self, decl: &FnDecl) -> PolyFnSig<'tcx>
[src]
fn error_sig_of_closure(&self, decl: &FnDecl) -> PolyFnSig<'tcx>
🔬 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?
Converts the types that the user supplied, in case that doing
so should yield an error, but returns back a signature where
all parameters are of type TyErr
.
fn closure_sigs(
&self,
expr_def_id: DefId,
body: &Body,
bound_sig: PolyFnSig<'tcx>
) -> ClosureSignatures<'tcx>
[src]
fn closure_sigs(
&self,
expr_def_id: DefId,
body: &Body,
bound_sig: PolyFnSig<'tcx>
) -> ClosureSignatures<'tcx>
🔬 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?
pub fn check_call(
&self,
call_expr: &'gcx Expr,
callee_expr: &'gcx Expr,
arg_exprs: &'gcx [Expr],
expected: Expectation<'tcx>
) -> Ty<'tcx>
[src]
pub fn check_call(
&self,
call_expr: &'gcx Expr,
callee_expr: &'gcx Expr,
arg_exprs: &'gcx [Expr],
expected: Expectation<'tcx>
) -> Ty<'tcx>
🔬 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?
fn try_overloaded_call_step(
&self,
call_expr: &'gcx Expr,
callee_expr: &'gcx Expr,
autoderef: &Autoderef<'a, 'gcx, 'tcx>
) -> Option<CallStep<'tcx>>
[src]
fn try_overloaded_call_step(
&self,
call_expr: &'gcx Expr,
callee_expr: &'gcx Expr,
autoderef: &Autoderef<'a, 'gcx, 'tcx>
) -> Option<CallStep<'tcx>>
🔬 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?
fn try_overloaded_call_traits(
&self,
call_expr: &Expr,
adjusted_ty: Ty<'tcx>
) -> Option<(Option<Adjustment<'tcx>>, MethodCallee<'tcx>)>
[src]
fn try_overloaded_call_traits(
&self,
call_expr: &Expr,
adjusted_ty: Ty<'tcx>
) -> Option<(Option<Adjustment<'tcx>>, MethodCallee<'tcx>)>
🔬 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?
fn confirm_builtin_call(
&self,
call_expr: &Expr,
callee_ty: Ty<'tcx>,
arg_exprs: &'gcx [Expr],
expected: Expectation<'tcx>
) -> Ty<'tcx>
[src]
fn confirm_builtin_call(
&self,
call_expr: &Expr,
callee_ty: Ty<'tcx>,
arg_exprs: &'gcx [Expr],
expected: Expectation<'tcx>
) -> Ty<'tcx>
🔬 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?
fn confirm_deferred_closure_call(
&self,
call_expr: &Expr,
arg_exprs: &'gcx [Expr],
expected: Expectation<'tcx>,
fn_sig: FnSig<'tcx>
) -> Ty<'tcx>
[src]
fn confirm_deferred_closure_call(
&self,
call_expr: &Expr,
arg_exprs: &'gcx [Expr],
expected: Expectation<'tcx>,
fn_sig: FnSig<'tcx>
) -> Ty<'tcx>
🔬 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?
fn confirm_overloaded_call(
&self,
call_expr: &Expr,
arg_exprs: &'gcx [Expr],
expected: Expectation<'tcx>,
method_callee: MethodCallee<'tcx>
) -> Ty<'tcx>
[src]
fn confirm_overloaded_call(
&self,
call_expr: &Expr,
arg_exprs: &'gcx [Expr],
expected: Expectation<'tcx>,
method_callee: MethodCallee<'tcx>
) -> Ty<'tcx>
🔬 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?
pub fn check_binop_assign(
&self,
expr: &'gcx Expr,
op: BinOp,
lhs_expr: &'gcx Expr,
rhs_expr: &'gcx Expr
) -> Ty<'tcx>
[src]
pub fn check_binop_assign(
&self,
expr: &'gcx Expr,
op: BinOp,
lhs_expr: &'gcx Expr,
rhs_expr: &'gcx Expr
) -> Ty<'tcx>
🔬 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?
Check a a <op>= b
pub fn check_binop(
&self,
expr: &'gcx Expr,
op: BinOp,
lhs_expr: &'gcx Expr,
rhs_expr: &'gcx Expr
) -> Ty<'tcx>
[src]
pub fn check_binop(
&self,
expr: &'gcx Expr,
op: BinOp,
lhs_expr: &'gcx Expr,
rhs_expr: &'gcx Expr
) -> Ty<'tcx>
🔬 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?
Check a potentially overloaded binary operator.
fn enforce_builtin_binop_types(
&self,
lhs_expr: &'gcx Expr,
lhs_ty: Ty<'tcx>,
rhs_expr: &'gcx Expr,
rhs_ty: Ty<'tcx>,
op: BinOp
) -> Ty<'tcx>
[src]
fn enforce_builtin_binop_types(
&self,
lhs_expr: &'gcx Expr,
lhs_ty: Ty<'tcx>,
rhs_expr: &'gcx Expr,
rhs_ty: Ty<'tcx>,
op: BinOp
) -> Ty<'tcx>
🔬 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?
fn check_overloaded_binop(
&self,
expr: &'gcx Expr,
lhs_expr: &'gcx Expr,
rhs_expr: &'gcx Expr,
op: BinOp,
is_assign: IsAssign
) -> (Ty<'tcx>, Ty<'tcx>, Ty<'tcx>)
[src]
fn check_overloaded_binop(
&self,
expr: &'gcx Expr,
lhs_expr: &'gcx Expr,
rhs_expr: &'gcx Expr,
op: BinOp,
is_assign: IsAssign
) -> (Ty<'tcx>, Ty<'tcx>, Ty<'tcx>)
🔬 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?
fn check_str_addition(
&self,
expr: &'gcx Expr,
lhs_expr: &'gcx Expr,
rhs_expr: &'gcx Expr,
lhs_ty: Ty<'tcx>,
rhs_ty: Ty<'tcx>,
err: &mut DiagnosticBuilder,
is_assign: bool
) -> bool
[src]
fn check_str_addition(
&self,
expr: &'gcx Expr,
lhs_expr: &'gcx Expr,
rhs_expr: &'gcx Expr,
lhs_ty: Ty<'tcx>,
rhs_ty: Ty<'tcx>,
err: &mut DiagnosticBuilder,
is_assign: bool
) -> bool
🔬 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?
pub fn check_user_unop(
&self,
ex: &'gcx Expr,
operand_ty: Ty<'tcx>,
op: UnOp
) -> Ty<'tcx>
[src]
pub fn check_user_unop(
&self,
ex: &'gcx Expr,
operand_ty: Ty<'tcx>,
op: UnOp
) -> Ty<'tcx>
🔬 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?
fn lookup_op_method(
&self,
lhs_ty: Ty<'tcx>,
other_tys: &[Ty<'tcx>],
op: Op
) -> Result<MethodCallee<'tcx>, ()>
[src]
fn lookup_op_method(
&self,
lhs_ty: Ty<'tcx>,
other_tys: &[Ty<'tcx>],
op: Op
) -> Result<MethodCallee<'tcx>, ()>
🔬 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?
pub fn sess(&self) -> &Session
[src]
pub fn sess(&self) -> &Session
🔬 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?
pub fn err_count_since_creation(&self) -> usize
[src]
pub fn err_count_since_creation(&self) -> usize
🔬 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?
fn warn_if_unreachable(&self, id: NodeId, span: Span, kind: &str)
[src]
fn warn_if_unreachable(&self, id: NodeId, span: Span, kind: &str)
🔬 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?
Produce warning on the given node, if the current point in the function is unreachable, and there hasn't been another warning.
pub fn cause(
&self,
span: Span,
code: ObligationCauseCode<'tcx>
) -> ObligationCause<'tcx>
[src]
pub fn cause(
&self,
span: Span,
code: ObligationCauseCode<'tcx>
) -> ObligationCause<'tcx>
🔬 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?
pub fn misc(&self, span: Span) -> ObligationCause<'tcx>
[src]
pub fn misc(&self, span: Span) -> ObligationCause<'tcx>
🔬 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?
fn resolve_type_vars_with_obligations(&self, ty: Ty<'tcx>) -> Ty<'tcx>
[src]
fn resolve_type_vars_with_obligations(&self, ty: Ty<'tcx>) -> Ty<'tcx>
🔬 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?
Resolves type variables in ty
if possible. Unlike the infcx
version (resolve_type_vars_if_possible), this version will
also select obligations if it seems useful, in an effort
to get more type information.
fn record_deferred_call_resolution(
&self,
closure_def_id: DefId,
r: DeferredCallResolution<'gcx, 'tcx>
)
[src]
fn record_deferred_call_resolution(
&self,
closure_def_id: DefId,
r: DeferredCallResolution<'gcx, 'tcx>
)
🔬 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?
fn remove_deferred_call_resolutions(
&self,
closure_def_id: DefId
) -> Vec<DeferredCallResolution<'gcx, 'tcx>>
[src]
fn remove_deferred_call_resolutions(
&self,
closure_def_id: DefId
) -> Vec<DeferredCallResolution<'gcx, 'tcx>>
🔬 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?
pub fn tag(&self) -> String
[src]
pub fn tag(&self) -> String
🔬 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?
pub fn local_ty(&self, span: Span, nid: NodeId) -> Ty<'tcx>
[src]
pub fn local_ty(&self, span: Span, nid: NodeId) -> Ty<'tcx>
🔬 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?
pub fn write_ty(&self, id: HirId, ty: Ty<'tcx>)
[src]
pub fn write_ty(&self, id: HirId, ty: Ty<'tcx>)
🔬 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?
pub fn write_field_index(&self, node_id: NodeId, index: usize)
[src]
pub fn write_field_index(&self, node_id: NodeId, index: usize)
🔬 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?
pub fn write_method_call(&self, hir_id: HirId, method: MethodCallee<'tcx>)
[src]
pub fn write_method_call(&self, hir_id: HirId, method: MethodCallee<'tcx>)
🔬 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?
pub fn write_substs(&self, node_id: HirId, substs: &'tcx Substs<'tcx>)
[src]
pub fn write_substs(&self, node_id: HirId, substs: &'tcx Substs<'tcx>)
🔬 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?
pub fn write_user_substs_from_substs(
&self,
hir_id: HirId,
substs: &'tcx Substs<'tcx>
)
[src]
pub fn write_user_substs_from_substs(
&self,
hir_id: HirId,
substs: &'tcx Substs<'tcx>
)
🔬 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?
Given the substs that we just converted from the HIR, try to canonicalize them and store them as user-given substitutions (i.e., substitutions that must be respected by the NLL check).
This should be invoked before any unifications have
occurred, so that annotations like Vec<_>
are preserved
properly.
pub fn write_user_substs(&self, hir_id: HirId, substs: CanonicalSubsts<'tcx>)
[src]
pub fn write_user_substs(&self, hir_id: HirId, substs: CanonicalSubsts<'tcx>)
🔬 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?
pub fn apply_adjustments(&self, expr: &Expr, adj: Vec<Adjustment<'tcx>>)
[src]
pub fn apply_adjustments(&self, expr: &Expr, adj: Vec<Adjustment<'tcx>>)
🔬 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?
fn instantiate_type_scheme<T>(
&self,
span: Span,
substs: &Substs<'tcx>,
value: &T
) -> T where
T: TypeFoldable<'tcx>,
[src]
fn instantiate_type_scheme<T>(
&self,
span: Span,
substs: &Substs<'tcx>,
value: &T
) -> T where
T: TypeFoldable<'tcx>,
🔬 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?
Basically whenever we are converting from a type scheme into the fn body space, we always want to normalize associated types as well. This function combines the two.
fn instantiate_bounds(
&self,
span: Span,
def_id: DefId,
substs: &Substs<'tcx>
) -> InstantiatedPredicates<'tcx>
[src]
fn instantiate_bounds(
&self,
span: Span,
def_id: DefId,
substs: &Substs<'tcx>
) -> InstantiatedPredicates<'tcx>
🔬 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?
As instantiate_type_scheme
, but for the bounds found in a
generic type scheme.
fn instantiate_opaque_types_from_return_value<T: TypeFoldable<'tcx>>(
&self,
fn_id: NodeId,
value: &T
) -> T
[src]
fn instantiate_opaque_types_from_return_value<T: TypeFoldable<'tcx>>(
&self,
fn_id: NodeId,
value: &T
) -> T
🔬 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?
Replace the opaque types from the return value of the
function with type variables and records the OpaqueTypeMap
for
later use during writeback. See
InferCtxt::instantiate_opaque_types
for more details.
fn normalize_associated_types_in<T>(&self, span: Span, value: &T) -> T where
T: TypeFoldable<'tcx>,
[src]
fn normalize_associated_types_in<T>(&self, span: Span, value: &T) -> T where
T: TypeFoldable<'tcx>,
🔬 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?
fn normalize_associated_types_in_as_infer_ok<T>(
&self,
span: Span,
value: &T
) -> InferOk<'tcx, T> where
T: TypeFoldable<'tcx>,
[src]
fn normalize_associated_types_in_as_infer_ok<T>(
&self,
span: Span,
value: &T
) -> InferOk<'tcx, T> where
T: TypeFoldable<'tcx>,
🔬 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?
pub fn require_type_meets(
&self,
ty: Ty<'tcx>,
span: Span,
code: ObligationCauseCode<'tcx>,
def_id: DefId
)
[src]
pub fn require_type_meets(
&self,
ty: Ty<'tcx>,
span: Span,
code: ObligationCauseCode<'tcx>,
def_id: DefId
)
🔬 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?
pub fn require_type_is_sized(
&self,
ty: Ty<'tcx>,
span: Span,
code: ObligationCauseCode<'tcx>
)
[src]
pub fn require_type_is_sized(
&self,
ty: Ty<'tcx>,
span: Span,
code: ObligationCauseCode<'tcx>
)
🔬 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?
pub fn register_bound(
&self,
ty: Ty<'tcx>,
def_id: DefId,
cause: ObligationCause<'tcx>
)
[src]
pub fn register_bound(
&self,
ty: Ty<'tcx>,
def_id: DefId,
cause: ObligationCause<'tcx>
)
🔬 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?
pub fn to_ty(&self, ast_t: &Ty) -> Ty<'tcx>
[src]
pub fn to_ty(&self, ast_t: &Ty) -> Ty<'tcx>
🔬 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?
pub fn node_ty(&self, id: HirId) -> Ty<'tcx>
[src]
pub fn node_ty(&self, id: HirId) -> Ty<'tcx>
🔬 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?
pub fn register_wf_obligation(
&self,
ty: Ty<'tcx>,
span: Span,
code: ObligationCauseCode<'tcx>
)
[src]
pub fn register_wf_obligation(
&self,
ty: Ty<'tcx>,
span: Span,
code: ObligationCauseCode<'tcx>
)
🔬 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?
Registers an obligation for checking later, during regionck, that the type ty
must
outlive the region r
.
pub fn add_wf_bounds(&self, substs: &Substs<'tcx>, expr: &Expr)
[src]
pub fn add_wf_bounds(&self, substs: &Substs<'tcx>, expr: &Expr)
🔬 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?
Registers obligations that all types appearing in substs
are well-formed.
pub fn add_obligations_for_parameters(
&self,
cause: ObligationCause<'tcx>,
predicates: &InstantiatedPredicates<'tcx>
)
[src]
pub fn add_obligations_for_parameters(
&self,
cause: ObligationCause<'tcx>,
predicates: &InstantiatedPredicates<'tcx>
)
🔬 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?
Given a fully substituted set of bounds (generic_bounds
), and the values with which each
type/region parameter was instantiated (substs
), creates and registers suitable
trait/region obligations.
For example, if there is a function:
fn foo<'a,T:'a>(...)
and a reference:
let f = foo;
Then we will create a fresh region variable '$0
and a fresh type variable $1
for 'a
and T
. This routine will add a region obligation $1:'$0
and register it locally.
pub fn field_ty(
&self,
span: Span,
field: &'tcx FieldDef,
substs: &Substs<'tcx>
) -> Ty<'tcx>
[src]
pub fn field_ty(
&self,
span: Span,
field: &'tcx FieldDef,
substs: &Substs<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_casts(&self)
[src]
fn check_casts(&self)
🔬 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?
fn resolve_generator_interiors(&self, def_id: DefId)
[src]
fn resolve_generator_interiors(&self, def_id: DefId)
🔬 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?
fn fallback_if_possible(&self, ty: Ty<'tcx>) -> bool
[src]
fn fallback_if_possible(&self, ty: Ty<'tcx>) -> bool
🔬 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?
fn select_all_obligations_or_error(&self)
[src]
fn select_all_obligations_or_error(&self)
🔬 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?
fn select_obligations_where_possible(&self, fallback_has_occurred: bool)
[src]
fn select_obligations_where_possible(&self, fallback_has_occurred: bool)
🔬 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?
Select as many obligations as we can at present.
fn is_place_expr(&self, expr: &Expr) -> bool
[src]
fn is_place_expr(&self, expr: &Expr) -> bool
🔬 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?
fn make_overloaded_place_return_type(
&self,
method: MethodCallee<'tcx>
) -> TypeAndMut<'tcx>
[src]
fn make_overloaded_place_return_type(
&self,
method: MethodCallee<'tcx>
) -> TypeAndMut<'tcx>
🔬 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?
For the overloaded place expressions (*x
, x[3]
), the trait
returns a type of &T
, but the actual type we assign to the
expression is T
. So this function just peels off the return
type by one layer to yield T
.
fn lookup_indexing(
&self,
expr: &Expr,
base_expr: &'gcx Expr,
base_ty: Ty<'tcx>,
idx_ty: Ty<'tcx>,
needs: Needs
) -> Option<(Ty<'tcx>, Ty<'tcx>)>
[src]
fn lookup_indexing(
&self,
expr: &Expr,
base_expr: &'gcx Expr,
base_ty: Ty<'tcx>,
idx_ty: Ty<'tcx>,
needs: Needs
) -> Option<(Ty<'tcx>, Ty<'tcx>)>
🔬 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?
fn try_index_step(
&self,
expr: &Expr,
base_expr: &Expr,
autoderef: &Autoderef<'a, 'gcx, 'tcx>,
needs: Needs,
index_ty: Ty<'tcx>
) -> Option<(Ty<'tcx>, Ty<'tcx>)>
[src]
fn try_index_step(
&self,
expr: &Expr,
base_expr: &Expr,
autoderef: &Autoderef<'a, 'gcx, 'tcx>,
needs: Needs,
index_ty: Ty<'tcx>
) -> Option<(Ty<'tcx>, Ty<'tcx>)>
🔬 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?
To type-check base_expr[index_expr]
, we progressively autoderef
(and otherwise adjust) base_expr
, looking for a type which either
supports builtin indexing or overloaded indexing.
This loop implements one step in that search; the autoderef loop
is implemented by lookup_indexing
.
fn resolve_place_op(&self, op: PlaceOp, is_mut: bool) -> (Option<DefId>, Ident)
[src]
fn resolve_place_op(&self, op: PlaceOp, is_mut: bool) -> (Option<DefId>, Ident)
🔬 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?
fn try_overloaded_place_op(
&self,
span: Span,
base_ty: Ty<'tcx>,
arg_tys: &[Ty<'tcx>],
needs: Needs,
op: PlaceOp
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>>
[src]
fn try_overloaded_place_op(
&self,
span: Span,
base_ty: Ty<'tcx>,
arg_tys: &[Ty<'tcx>],
needs: Needs,
op: PlaceOp
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>>
🔬 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?
fn check_method_argument_types(
&self,
sp: Span,
expr_sp: Span,
method: Result<MethodCallee<'tcx>, ()>,
args_no_rcvr: &'gcx [Expr],
tuple_arguments: TupleArgumentsFlag,
expected: Expectation<'tcx>
) -> Ty<'tcx>
[src]
fn check_method_argument_types(
&self,
sp: Span,
expr_sp: Span,
method: Result<MethodCallee<'tcx>, ()>,
args_no_rcvr: &'gcx [Expr],
tuple_arguments: TupleArgumentsFlag,
expected: Expectation<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_argument_types(
&self,
sp: Span,
expr_sp: Span,
fn_inputs: &[Ty<'tcx>],
expected_arg_tys: &[Ty<'tcx>],
args: &'gcx [Expr],
variadic: bool,
tuple_arguments: TupleArgumentsFlag,
def_span: Option<Span>
)
[src]
fn check_argument_types(
&self,
sp: Span,
expr_sp: Span,
fn_inputs: &[Ty<'tcx>],
expected_arg_tys: &[Ty<'tcx>],
args: &'gcx [Expr],
variadic: bool,
tuple_arguments: TupleArgumentsFlag,
def_span: Option<Span>
)
🔬 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?
Generic function that factors out common logic from function calls, method calls and overloaded operators.
fn err_args(&self, len: usize) -> Vec<Ty<'tcx>>
[src]
fn err_args(&self, len: usize) -> Vec<Ty<'tcx>>
🔬 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?
fn check_lit(&self, lit: &Lit, expected: Expectation<'tcx>) -> Ty<'tcx>
[src]
fn check_lit(&self, lit: &Lit, expected: Expectation<'tcx>) -> Ty<'tcx>
🔬 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?
fn check_expr_eq_type(&self, expr: &'gcx Expr, expected: Ty<'tcx>)
[src]
fn check_expr_eq_type(&self, expr: &'gcx Expr, expected: Ty<'tcx>)
🔬 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?
pub fn check_expr_has_type_or_error(
&self,
expr: &'gcx Expr,
expected: Ty<'tcx>
) -> Ty<'tcx>
[src]
pub fn check_expr_has_type_or_error(
&self,
expr: &'gcx Expr,
expected: Ty<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_expr_meets_expectation_or_error(
&self,
expr: &'gcx Expr,
expected: Expectation<'tcx>
) -> Ty<'tcx>
[src]
fn check_expr_meets_expectation_or_error(
&self,
expr: &'gcx Expr,
expected: Expectation<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_expr_coercable_to_type(
&self,
expr: &'gcx Expr,
expected: Ty<'tcx>
) -> Ty<'tcx>
[src]
fn check_expr_coercable_to_type(
&self,
expr: &'gcx Expr,
expected: Ty<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_expr_with_hint(&self, expr: &'gcx Expr, expected: Ty<'tcx>) -> Ty<'tcx>
[src]
fn check_expr_with_hint(&self, expr: &'gcx Expr, expected: Ty<'tcx>) -> Ty<'tcx>
🔬 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?
fn check_expr_with_expectation(
&self,
expr: &'gcx Expr,
expected: Expectation<'tcx>
) -> Ty<'tcx>
[src]
fn check_expr_with_expectation(
&self,
expr: &'gcx Expr,
expected: Expectation<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_expr(&self, expr: &'gcx Expr) -> Ty<'tcx>
[src]
fn check_expr(&self, expr: &'gcx Expr) -> Ty<'tcx>
🔬 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?
fn check_expr_with_needs(&self, expr: &'gcx Expr, needs: Needs) -> Ty<'tcx>
[src]
fn check_expr_with_needs(&self, expr: &'gcx Expr, needs: Needs) -> Ty<'tcx>
🔬 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?
pub fn impl_self_ty(&self, span: Span, did: DefId) -> TypeAndSubsts<'tcx>
[src]
pub fn impl_self_ty(&self, span: Span, did: DefId) -> TypeAndSubsts<'tcx>
🔬 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?
fn expected_inputs_for_expected_output(
&self,
call_span: Span,
expected_ret: Expectation<'tcx>,
formal_ret: Ty<'tcx>,
formal_args: &[Ty<'tcx>]
) -> Vec<Ty<'tcx>>
[src]
fn expected_inputs_for_expected_output(
&self,
call_span: Span,
expected_ret: Expectation<'tcx>,
formal_ret: Ty<'tcx>,
formal_args: &[Ty<'tcx>]
) -> Vec<Ty<'tcx>>
🔬 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?
Unifies the output type with the expected type early, for more coercions and forward type information on the input expressions.
fn check_method_call(
&self,
expr: &'gcx Expr,
segment: &PathSegment,
span: Span,
args: &'gcx [Expr],
expected: Expectation<'tcx>,
needs: Needs
) -> Ty<'tcx>
[src]
fn check_method_call(
&self,
expr: &'gcx Expr,
segment: &PathSegment,
span: Span,
args: &'gcx [Expr],
expected: Expectation<'tcx>,
needs: Needs
) -> Ty<'tcx>
🔬 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?
fn check_return_expr(&self, return_expr: &'gcx Expr)
[src]
fn check_return_expr(&self, return_expr: &'gcx Expr)
🔬 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?
fn check_then_else(
&self,
cond_expr: &'gcx Expr,
then_expr: &'gcx Expr,
opt_else_expr: Option<&'gcx Expr>,
sp: Span,
expected: Expectation<'tcx>
) -> Ty<'tcx>
[src]
fn check_then_else(
&self,
cond_expr: &'gcx Expr,
then_expr: &'gcx Expr,
opt_else_expr: Option<&'gcx Expr>,
sp: Span,
expected: Expectation<'tcx>
) -> Ty<'tcx>
🔬 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?
fn check_field(
&self,
expr: &'gcx Expr,
needs: Needs,
base: &'gcx Expr,
field: Ident
) -> Ty<'tcx>
[src]
fn check_field(
&self,
expr: &'gcx Expr,
needs: Needs,
base: &'gcx Expr,
field: Ident
) -> Ty<'tcx>
🔬 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?
fn available_field_names(&self, variant: &'tcx VariantDef) -> Vec<Name>
[src]
fn available_field_names(&self, variant: &'tcx VariantDef) -> Vec<Name>
🔬 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?
fn name_series_display(&self, names: Vec<Name>) -> String
[src]
fn name_series_display(&self, names: Vec<Name>) -> String
🔬 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?
fn no_such_field_err<T: Display>(
&self,
span: Span,
field: T,
expr_t: &TyS
) -> DiagnosticBuilder
[src]
fn no_such_field_err<T: Display>(
&self,
span: Span,
field: T,
expr_t: &TyS
) -> DiagnosticBuilder
🔬 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?
fn report_unknown_field(
&self,
ty: Ty<'tcx>,
variant: &'tcx VariantDef,
field: &Field,
skip_fields: &[Field],
kind_name: &str
)
[src]
fn report_unknown_field(
&self,
ty: Ty<'tcx>,
variant: &'tcx VariantDef,
field: &Field,
skip_fields: &[Field],
kind_name: &str
)
🔬 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?
fn check_expr_struct_fields(
&self,
adt_ty: Ty<'tcx>,
expected: Expectation<'tcx>,
expr_id: NodeId,
span: Span,
variant: &'tcx VariantDef,
ast_fields: &'gcx [Field],
check_completeness: bool
) -> bool
[src]
fn check_expr_struct_fields(
&self,
adt_ty: Ty<'tcx>,
expected: Expectation<'tcx>,
expr_id: NodeId,
span: Span,
variant: &'tcx VariantDef,
ast_fields: &'gcx [Field],
check_completeness: bool
) -> bool
🔬 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?
fn check_struct_fields_on_error(
&self,
fields: &'gcx [Field],
base_expr: &'gcx Option<P<Expr>>
)
[src]
fn check_struct_fields_on_error(
&self,
fields: &'gcx [Field],
base_expr: &'gcx Option<P<Expr>>
)
🔬 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?
pub fn check_struct_path(
&self,
qpath: &QPath,
node_id: NodeId
) -> Option<(&'tcx VariantDef, Ty<'tcx>)>
[src]
pub fn check_struct_path(
&self,
qpath: &QPath,
node_id: NodeId
) -> Option<(&'tcx VariantDef, Ty<'tcx>)>
🔬 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?
fn check_expr_struct(
&self,
expr: &Expr,
expected: Expectation<'tcx>,
qpath: &QPath,
fields: &'gcx [Field],
base_expr: &'gcx Option<P<Expr>>
) -> Ty<'tcx>
[src]
fn check_expr_struct(
&self,
expr: &Expr,
expected: Expectation<'tcx>,
qpath: &QPath,
fields: &'gcx [Field],
base_expr: &'gcx Option<P<Expr>>
) -> Ty<'tcx>
🔬 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?
fn check_expr_with_expectation_and_needs(
&self,
expr: &'gcx Expr,
expected: Expectation<'tcx>,
needs: Needs
) -> Ty<'tcx>
[src]
fn check_expr_with_expectation_and_needs(
&self,
expr: &'gcx Expr,
expected: Expectation<'tcx>,
needs: Needs
) -> Ty<'tcx>
🔬 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?
Invariant:
If an expression has any sub-expressions that result in a type error,
inspecting that expression's type with ty.references_error()
will return
true. Likewise, if an expression is known to diverge, inspecting its
type with ty::type_is_bot
will return true (n.b.: since Rust is
strict, | can appear in the type of an expression that does not,
itself, diverge: for example, fn() -> |.)
Note that inspecting a type's structure directly may expose the fact
that there are actually multiple representations for Error
, so avoid
that when err needs to be handled differently.
fn check_expr_kind(
&self,
expr: &'gcx Expr,
expected: Expectation<'tcx>,
needs: Needs
) -> Ty<'tcx>
[src]
fn check_expr_kind(
&self,
expr: &'gcx Expr,
expected: Expectation<'tcx>,
needs: Needs
) -> Ty<'tcx>
🔬 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?
fn finish_resolving_struct_path(
&self,
qpath: &QPath,
path_span: Span,
node_id: NodeId
) -> (Def, Ty<'tcx>)
[src]
fn finish_resolving_struct_path(
&self,
qpath: &QPath,
path_span: Span,
node_id: NodeId
) -> (Def, Ty<'tcx>)
🔬 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?
pub fn resolve_ty_and_def_ufcs<'b>(
&self,
qpath: &'b QPath,
node_id: NodeId,
span: Span
) -> (Def, Option<Ty<'tcx>>, &'b [PathSegment])
[src]
pub fn resolve_ty_and_def_ufcs<'b>(
&self,
qpath: &'b QPath,
node_id: NodeId,
span: Span
) -> (Def, Option<Ty<'tcx>>, &'b [PathSegment])
🔬 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?
pub fn check_decl_initializer(
&self,
local: &'gcx Local,
init: &'gcx Expr
) -> Ty<'tcx>
[src]
pub fn check_decl_initializer(
&self,
local: &'gcx Local,
init: &'gcx Expr
) -> Ty<'tcx>
🔬 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?
pub fn check_decl_local(&self, local: &'gcx Local)
[src]
pub fn check_decl_local(&self, local: &'gcx Local)
🔬 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?
pub fn check_stmt(&self, stmt: &'gcx Stmt)
[src]
pub fn check_stmt(&self, stmt: &'gcx Stmt)
🔬 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?
pub fn check_block_no_value(&self, blk: &'gcx Block)
[src]
pub fn check_block_no_value(&self, blk: &'gcx Block)
🔬 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?
fn check_block_with_expected(
&self,
blk: &'gcx Block,
expected: Expectation<'tcx>
) -> Ty<'tcx>
[src]
fn check_block_with_expected(
&self,
blk: &'gcx Block,
expected: Expectation<'tcx>
) -> Ty<'tcx>
🔬 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?
pub fn get_fn_decl(&self, blk_id: NodeId) -> Option<(FnDecl, bool)>
[src]
pub fn get_fn_decl(&self, blk_id: NodeId) -> Option<(FnDecl, bool)>
🔬 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?
Given a NodeId
, return the FnDecl
of the method it is enclosed by and whether a
suggestion can be made, None
otherwise.
pub fn suggest_mismatched_types_on_tail(
&self,
err: &mut DiagnosticBuilder<'tcx>,
expression: &'gcx Expr,
expected: Ty<'tcx>,
found: Ty<'tcx>,
cause_span: Span,
blk_id: NodeId
)
[src]
pub fn suggest_mismatched_types_on_tail(
&self,
err: &mut DiagnosticBuilder<'tcx>,
expression: &'gcx Expr,
expected: Ty<'tcx>,
found: Ty<'tcx>,
cause_span: Span,
blk_id: NodeId
)
🔬 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?
On implicit return expressions with mismatched types, provide the following suggestions:
- Point out the method's return type as the reason for the expected type
- Possible missing semicolon
- Possible missing return type if the return type is the default, and not
fn main()
pub fn suggest_ref_or_into(
&self,
err: &mut DiagnosticBuilder<'tcx>,
expr: &Expr,
expected: Ty<'tcx>,
found: Ty<'tcx>
)
[src]
pub fn suggest_ref_or_into(
&self,
err: &mut DiagnosticBuilder<'tcx>,
expr: &Expr,
expected: Ty<'tcx>,
found: Ty<'tcx>
)
🔬 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?
fn suggest_missing_semicolon(
&self,
err: &mut DiagnosticBuilder<'tcx>,
expression: &'gcx Expr,
expected: Ty<'tcx>,
cause_span: Span
)
[src]
fn suggest_missing_semicolon(
&self,
err: &mut DiagnosticBuilder<'tcx>,
expression: &'gcx Expr,
expected: Ty<'tcx>,
cause_span: Span
)
🔬 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?
A common error is to forget to add a semicolon at the end of a block:
fn foo() { bar_that_returns_u32() }
This routine checks if the return expression in a block would make sense on its own as a
statement and the return type has been left as default or has been specified as ()
. If so,
it suggests adding a semicolon.
fn suggest_missing_return_type(
&self,
err: &mut DiagnosticBuilder<'tcx>,
fn_decl: &FnDecl,
expected: Ty<'tcx>,
found: Ty<'tcx>,
can_suggest: bool
)
[src]
fn suggest_missing_return_type(
&self,
err: &mut DiagnosticBuilder<'tcx>,
fn_decl: &FnDecl,
expected: Ty<'tcx>,
found: Ty<'tcx>,
can_suggest: bool
)
🔬 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?
A possible error is to forget to add a return type that is needed:
fn foo() { bar_that_returns_u32() }
This routine checks if the return type is left as default, the method is not part of an
impl
block and that it isn't the main
method. If so, it suggests setting the return
type.
fn consider_hint_about_removing_semicolon(
&self,
blk: &'gcx Block,
expected_ty: Ty<'tcx>,
err: &mut DiagnosticBuilder
)
[src]
fn consider_hint_about_removing_semicolon(
&self,
blk: &'gcx Block,
expected_ty: Ty<'tcx>,
err: &mut DiagnosticBuilder
)
🔬 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?
A common error is to add an extra semicolon:
fn foo() -> usize { 22; }
This routine checks if the final statement in a block is an
expression with an explicit semicolon whose type is compatible
with expected_ty
. If so, it suggests removing the semicolon.
fn def_ids_for_path_segments(
&self,
segments: &[PathSegment],
def: Def
) -> Vec<PathSeg>
[src]
fn def_ids_for_path_segments(
&self,
segments: &[PathSegment],
def: Def
) -> Vec<PathSeg>
🔬 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?
pub fn instantiate_value_path(
&self,
segments: &[PathSegment],
self_ty: Option<Ty<'tcx>>,
def: Def,
span: Span,
node_id: NodeId
) -> (Ty<'tcx>, Def)
[src]
pub fn instantiate_value_path(
&self,
segments: &[PathSegment],
self_ty: Option<Ty<'tcx>>,
def: Def,
span: Span,
node_id: NodeId
) -> (Ty<'tcx>, Def)
🔬 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?
fn check_rustc_args_require_const(
&self,
def_id: DefId,
node_id: NodeId,
span: Span
)
[src]
fn check_rustc_args_require_const(
&self,
def_id: DefId,
node_id: NodeId,
span: Span
)
🔬 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?
pub fn structurally_resolved_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx>
[src]
pub fn structurally_resolved_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx>
🔬 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?
fn with_breakable_ctxt<F: FnOnce() -> R, R>(
&self,
id: NodeId,
ctxt: BreakableCtxt<'gcx, 'tcx>,
f: F
) -> (BreakableCtxt<'gcx, 'tcx>, R)
[src]
fn with_breakable_ctxt<F: FnOnce() -> R, R>(
&self,
id: NodeId,
ctxt: BreakableCtxt<'gcx, 'tcx>,
f: F
) -> (BreakableCtxt<'gcx, 'tcx>, R)
🔬 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?
Trait Implementations
impl<'a, 'gcx, 'tcx> Deref for RegionCtxt<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> Deref for RegionCtxt<'a, 'gcx, 'tcx>
type Target = FnCtxt<'a, 'gcx, 'tcx>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
fn deref(&self) -> &Self::Target
Dereferences the value.
impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx>
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'gcx>
[src]
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'gcx>
🔬 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?
The default versions of the visit_nested_XXX
routines invoke this method to get a map to use. By selecting an enum variant, you control which kinds of nested HIR are visited; see NestedVisitorMap
for details. By "nested HIR", we are referring to bits of HIR that are not directly embedded within one another but rather indirectly, through a table in the crate. This is done to control dependencies during incremental compilation: the non-inline bits of HIR can be tracked and hashed separately. Read more
fn visit_fn(
&mut self,
fk: FnKind<'gcx>,
_: &'gcx FnDecl,
body_id: BodyId,
span: Span,
id: NodeId
)
[src]
fn visit_fn(
&mut self,
fk: FnKind<'gcx>,
_: &'gcx FnDecl,
body_id: BodyId,
span: Span,
id: NodeId
)
🔬 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?
fn visit_arm(&mut self, arm: &'gcx Arm)
[src]
fn visit_arm(&mut self, arm: &'gcx Arm)
🔬 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?
fn visit_local(&mut self, l: &'gcx Local)
[src]
fn visit_local(&mut self, l: &'gcx Local)
🔬 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?
fn visit_expr(&mut self, expr: &'gcx Expr)
[src]
fn visit_expr(&mut self, expr: &'gcx Expr)
🔬 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?
fn visit_nested_item(&mut self, id: ItemId)
[src]
fn visit_nested_item(&mut self, id: ItemId)
🔬 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?
Invoked when a nested item is encountered. By default does nothing unless you override nested_visit_map
to return Some(_)
, in which case it will walk the item. You probably don't want to override this method -- instead, override nested_visit_map
or use the "shallow" or "deep" visit patterns described on itemlikevisit::ItemLikeVisitor
. The only reason to override this method is if you want a nested pattern but cannot supply a Map
; see nested_visit_map
for advice. Read more
fn visit_nested_trait_item(&mut self, id: TraitItemId)
[src]
fn visit_nested_trait_item(&mut self, id: TraitItemId)
🔬 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?
Like visit_nested_item()
, but for trait items. See visit_nested_item()
for advice on when to override this method. Read more
fn visit_nested_impl_item(&mut self, id: ImplItemId)
[src]
fn visit_nested_impl_item(&mut self, id: ImplItemId)
🔬 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?
Like visit_nested_item()
, but for impl items. See visit_nested_item()
for advice on when to override this method. Read more
fn visit_nested_body(&mut self, id: BodyId)
[src]
fn visit_nested_body(&mut self, id: BodyId)
🔬 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?
Invoked to visit the body of a function, method or closure. Like visit_nested_item, does nothing by default unless you override nested_visit_map
to return Some(_)
, in which case it will walk the body. Read more
fn visit_item(&mut self, i: &'v Item)
[src]
fn visit_item(&mut self, i: &'v Item)
🔬 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?
Visit the top-level item and (optionally) nested items / impl items. See visit_nested_item
for details. Read more
fn visit_body(&mut self, b: &'v Body)
[src]
fn visit_body(&mut self, b: &'v Body)
🔬 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?
fn as_deep_visitor(&'s mut self) -> DeepVisitor<'s, Self>
[src]
fn as_deep_visitor(&'s mut self) -> DeepVisitor<'s, Self>
🔬 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?
When invoking visit_all_item_likes()
, you need to supply an item-like visitor. This method converts a "intra-visit" visitor into an item-like visitor that walks the entire tree. If you use this, you probably don't want to process the contents of nested item-like things, since the outer loop will visit them as well. Read more
fn visit_id(&mut self, _node_id: NodeId)
[src]
fn visit_id(&mut self, _node_id: NodeId)
🔬 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?
fn visit_def_mention(&mut self, _def: Def)
[src]
fn visit_def_mention(&mut self, _def: Def)
🔬 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?
fn visit_name(&mut self, _span: Span, _name: Symbol)
[src]
fn visit_name(&mut self, _span: Span, _name: Symbol)
🔬 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?
fn visit_ident(&mut self, ident: Ident)
[src]
fn visit_ident(&mut self, ident: Ident)
🔬 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?
fn visit_mod(&mut self, m: &'v Mod, _s: Span, n: NodeId)
[src]
fn visit_mod(&mut self, m: &'v Mod, _s: Span, n: NodeId)
🔬 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?
fn visit_foreign_item(&mut self, i: &'v ForeignItem)
[src]
fn visit_foreign_item(&mut self, i: &'v ForeignItem)
🔬 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?
fn visit_block(&mut self, b: &'v Block)
[src]
fn visit_block(&mut self, b: &'v Block)
🔬 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?
fn visit_stmt(&mut self, s: &'v Spanned<StmtKind>)
[src]
fn visit_stmt(&mut self, s: &'v Spanned<StmtKind>)
🔬 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?
fn visit_pat(&mut self, p: &'v Pat)
[src]
fn visit_pat(&mut self, p: &'v Pat)
🔬 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?
fn visit_decl(&mut self, d: &'v Spanned<DeclKind>)
[src]
fn visit_decl(&mut self, d: &'v Spanned<DeclKind>)
🔬 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?
fn visit_anon_const(&mut self, c: &'v AnonConst)
[src]
fn visit_anon_const(&mut self, c: &'v AnonConst)
🔬 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?
fn visit_ty(&mut self, t: &'v Ty)
[src]
fn visit_ty(&mut self, t: &'v Ty)
🔬 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?
fn visit_generic_param(&mut self, p: &'v GenericParam)
[src]
fn visit_generic_param(&mut self, p: &'v GenericParam)
🔬 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?
fn visit_generics(&mut self, g: &'v Generics)
[src]
fn visit_generics(&mut self, g: &'v Generics)
🔬 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?
fn visit_where_predicate(&mut self, predicate: &'v WherePredicate)
[src]
fn visit_where_predicate(&mut self, predicate: &'v WherePredicate)
🔬 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?
fn visit_fn_decl(&mut self, fd: &'v FnDecl)
[src]
fn visit_fn_decl(&mut self, fd: &'v FnDecl)
🔬 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?
fn visit_trait_item(&mut self, ti: &'v TraitItem)
[src]
fn visit_trait_item(&mut self, ti: &'v TraitItem)
🔬 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?
fn visit_trait_item_ref(&mut self, ii: &'v TraitItemRef)
[src]
fn visit_trait_item_ref(&mut self, ii: &'v TraitItemRef)
🔬 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?
fn visit_impl_item(&mut self, ii: &'v ImplItem)
[src]
fn visit_impl_item(&mut self, ii: &'v ImplItem)
🔬 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?
fn visit_impl_item_ref(&mut self, ii: &'v ImplItemRef)
[src]
fn visit_impl_item_ref(&mut self, ii: &'v ImplItemRef)
🔬 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?
fn visit_trait_ref(&mut self, t: &'v TraitRef)
[src]
fn visit_trait_ref(&mut self, t: &'v TraitRef)
🔬 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?
fn visit_param_bound(&mut self, bounds: &'v GenericBound)
[src]
fn visit_param_bound(&mut self, bounds: &'v GenericBound)
🔬 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?
fn visit_poly_trait_ref(&mut self, t: &'v PolyTraitRef, m: TraitBoundModifier)
[src]
fn visit_poly_trait_ref(&mut self, t: &'v PolyTraitRef, m: TraitBoundModifier)
🔬 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?
fn visit_variant_data(
&mut self,
s: &'v VariantData,
Symbol,
&'v Generics,
_parent_id: NodeId,
Span
)
[src]
fn visit_variant_data(
&mut self,
s: &'v VariantData,
Symbol,
&'v Generics,
_parent_id: NodeId,
Span
)
🔬 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?
fn visit_struct_field(&mut self, s: &'v StructField)
[src]
fn visit_struct_field(&mut self, s: &'v StructField)
🔬 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?
fn visit_enum_def(
&mut self,
enum_definition: &'v EnumDef,
generics: &'v Generics,
item_id: NodeId,
Span
)
[src]
fn visit_enum_def(
&mut self,
enum_definition: &'v EnumDef,
generics: &'v Generics,
item_id: NodeId,
Span
)
🔬 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?
fn visit_variant(
&mut self,
v: &'v Spanned<VariantKind>,
g: &'v Generics,
item_id: NodeId
)
[src]
fn visit_variant(
&mut self,
v: &'v Spanned<VariantKind>,
g: &'v Generics,
item_id: NodeId
)
🔬 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?
fn visit_label(&mut self, label: &'v Label)
[src]
fn visit_label(&mut self, label: &'v Label)
🔬 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?
fn visit_generic_arg(&mut self, generic_arg: &'v GenericArg)
[src]
fn visit_generic_arg(&mut self, generic_arg: &'v GenericArg)
🔬 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?
fn visit_lifetime(&mut self, lifetime: &'v Lifetime)
[src]
fn visit_lifetime(&mut self, lifetime: &'v Lifetime)
🔬 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?
fn visit_qpath(&mut self, qpath: &'v QPath, id: HirId, span: Span)
[src]
fn visit_qpath(&mut self, qpath: &'v QPath, id: HirId, span: Span)
🔬 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?
fn visit_path(&mut self, path: &'v Path, _id: HirId)
[src]
fn visit_path(&mut self, path: &'v Path, _id: HirId)
🔬 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?
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v PathSegment)
[src]
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v PathSegment)
🔬 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?
fn visit_generic_args(&mut self, path_span: Span, generic_args: &'v GenericArgs)
[src]
fn visit_generic_args(&mut self, path_span: Span, generic_args: &'v GenericArgs)
🔬 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?
fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding)
[src]
fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding)
🔬 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?
fn visit_attribute(&mut self, _attr: &'v Attribute)
[src]
fn visit_attribute(&mut self, _attr: &'v Attribute)
🔬 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?
fn visit_macro_def(&mut self, macro_def: &'v MacroDef)
[src]
fn visit_macro_def(&mut self, macro_def: &'v MacroDef)
🔬 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?
fn visit_vis(&mut self, vis: &'v Spanned<VisibilityKind>)
[src]
fn visit_vis(&mut self, vis: &'v Spanned<VisibilityKind>)
🔬 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?
fn visit_associated_item_kind(&mut self, kind: &'v AssociatedItemKind)
[src]
fn visit_associated_item_kind(&mut self, kind: &'v AssociatedItemKind)
🔬 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?
fn visit_defaultness(&mut self, defaultness: &'v Defaultness)
[src]
fn visit_defaultness(&mut self, defaultness: &'v Defaultness)
🔬 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?
Auto Trait Implementations
impl<'a, 'gcx, 'tcx> !Send for RegionCtxt<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Send for RegionCtxt<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for RegionCtxt<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for RegionCtxt<'a, 'gcx, 'tcx>
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
[src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
🔬 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?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> Erased for T
impl<T> Erased for T
impl<T> MaybeResult for T
[src]
impl<T> MaybeResult for T
fn from_ok(x: T) -> T
[src]
fn from_ok(x: T) -> T
🔬 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?
fn map_same<F>(self, f: F) -> T where
F: FnOnce(T) -> T,
[src]
fn map_same<F>(self, f: F) -> T where
F: FnOnce(T) -> T,
🔬 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?
impl<'a, T> Captures for T where
T: ?Sized,
[src]
impl<'a, T> Captures for T where
T: ?Sized,