Struct rustc::infer::error_reporting::nice_region_error::NiceRegionError [−][src]
pub struct NiceRegionError<'cx, 'gcx: 'tcx, 'tcx: 'cx> { tcx: TyCtxt<'cx, 'gcx, 'tcx>, error: Option<RegionResolutionError<'tcx>>, regions: Option<(Span, Region<'tcx>, Region<'tcx>)>, tables: Option<&'cx TypeckTables<'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?
Fields
tcx: TyCtxt<'cx, '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?
error: Option<RegionResolutionError<'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?
regions: Option<(Span, Region<'tcx>, 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?
tables: Option<&'cx TypeckTables<'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?
Methods
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
pub(super) fn try_report_anon_anon_conflict(
&self
) -> Option<ErrorReported>
[src]
pub(super) fn try_report_anon_anon_conflict(
&self
) -> Option<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?
Print the error message for lifetime errors when both the concerned regions are anonymous.
Consider a case where we have
fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
The example gives
fn foo(x: &mut Vec<&u8>, y: &u8) {
--- --- these references are declared with different lifetimes...
x.push(y);
^ ...but data from `y` flows into `x` here
It has been extended for the case of structs too.
Consider the example
struct Ref<'a> { x: &'a u32 }
fn foo(mut x: Vec<Ref>, y: Ref) {
--- --- these structs are declared with different lifetimes...
x.push(y);
^ ...but data from `y` flows into `x` here
}
It will later be extended to trait objects.
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
pub(super) fn find_anon_type(
&self,
region: Region<'tcx>,
br: &BoundRegion
) -> Option<(&Ty, &FnDecl)>
[src]
pub(super) fn find_anon_type(
&self,
region: Region<'tcx>,
br: &BoundRegion
) -> Option<(&Ty, &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?
This function calls the visit_ty
method for the parameters
corresponding to the anonymous regions. The nested_visitor.found_type
contains the anonymous type.
Arguments
region - the anonymous region corresponding to the anon_anon conflict
br - the bound region corresponding to the above region which is of type BrAnon(_)
Example
fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
The function returns the nested type corresponding to the anonymous region
for e.g. &u8
and Vec<&u8
.
fn find_component_for_bound_region(
&self,
arg: &'gcx Ty,
br: &BoundRegion
) -> Option<&'gcx Ty>
[src]
fn find_component_for_bound_region(
&self,
arg: &'gcx Ty,
br: &BoundRegion
) -> Option<&'gcx 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?
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
pub(super) fn try_report_named_anon_conflict(
&self
) -> Option<ErrorReported>
[src]
pub(super) fn try_report_named_anon_conflict(
&self
) -> Option<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?
When given a ConcreteFailure
for a function with arguments containing a named region and
an anonymous region, emit an descriptive diagnostic error.
pub(super) fn is_named_region(
&self,
region: Region<'tcx>
) -> bool
[src]
pub(super) fn is_named_region(
&self,
region: Region<'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?
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
pub(super) fn try_report_outlives_closure(
&self
) -> Option<ErrorReported>
[src]
pub(super) fn try_report_outlives_closure(
&self
) -> Option<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?
Print the error message for lifetime errors when binding excapes a closure.
Consider a case where we have
fn with_int<F>(f: F) where F: FnOnce(&isize) { let x = 3; f(&x); } fn main() { let mut x = None; with_int(|y| x = Some(y)); }
the output will be
let mut x = None;
----- borrowed data cannot be stored into here...
with_int(|y| x = Some(y));
--- ^ cannot be stored outside of its closure
|
...because it cannot outlive this closure
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx>
pub(super) fn find_arg_with_region(
&self,
anon_region: Region<'tcx>,
replace_region: Region<'tcx>
) -> Option<AnonymousArgInfo>
[src]
pub(super) fn find_arg_with_region(
&self,
anon_region: Region<'tcx>,
replace_region: Region<'tcx>
) -> Option<AnonymousArgInfo>
🔬 This is a nightly-only experimental API. (rustc_private
)
this 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(super) fn is_suitable_region(
&self,
region: Region<'tcx>
) -> Option<FreeRegionInfo>
[src]
pub(super) fn is_suitable_region(
&self,
region: Region<'tcx>
) -> Option<FreeRegionInfo>
🔬 This is a nightly-only experimental API. (rustc_private
)
this 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(super) fn is_return_type_anon(
&self,
scope_def_id: DefId,
br: BoundRegion,
decl: &FnDecl
) -> Option<Span>
[src]
pub(super) fn is_return_type_anon(
&self,
scope_def_id: DefId,
br: BoundRegion,
decl: &FnDecl
) -> 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?
pub(super) fn is_self_anon(
&self,
is_first: bool,
scope_def_id: DefId
) -> bool
[src]
pub(super) fn is_self_anon(
&self,
is_first: bool,
scope_def_id: 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?
pub(super) fn is_bound_region_in_impl_item(
&self,
suitable_region_binding_scope: DefId
) -> bool
[src]
pub(super) fn is_bound_region_in_impl_item(
&self,
suitable_region_binding_scope: 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?
impl<'cx, 'gcx, 'tcx> NiceRegionError<'cx, 'gcx, 'tcx>
[src]
impl<'cx, 'gcx, 'tcx> NiceRegionError<'cx, 'gcx, 'tcx>
pub fn new(
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
error: RegionResolutionError<'tcx>,
tables: Option<&'cx TypeckTables<'tcx>>
) -> Self
[src]
pub fn new(
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
error: RegionResolutionError<'tcx>,
tables: Option<&'cx TypeckTables<'tcx>>
) -> 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?
pub fn new_from_span(
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
span: Span,
sub: Region<'tcx>,
sup: Region<'tcx>,
tables: Option<&'cx TypeckTables<'tcx>>
) -> Self
[src]
pub fn new_from_span(
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
span: Span,
sub: Region<'tcx>,
sup: Region<'tcx>,
tables: Option<&'cx TypeckTables<'tcx>>
) -> 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?
pub fn try_report(&self) -> Option<ErrorReported>
[src]
pub fn try_report(&self) -> Option<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?
pub fn get_regions(&self) -> (Span, Region<'tcx>, Region<'tcx>)
[src]
pub fn get_regions(&self) -> (Span, Region<'tcx>, 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?
Auto Trait Implementations
impl<'cx, 'gcx, 'tcx> !Send for NiceRegionError<'cx, 'gcx, 'tcx>
impl<'cx, 'gcx, 'tcx> !Send for NiceRegionError<'cx, 'gcx, 'tcx>
impl<'cx, 'gcx, 'tcx> !Sync for NiceRegionError<'cx, 'gcx, 'tcx>
impl<'cx, 'gcx, 'tcx> !Sync for NiceRegionError<'cx, 'gcx, 'tcx>