1use std::cmp::max;
54use std::iter;
55
56use rustc_hir as hir;
57use rustc_middle::bug;
58use rustc_middle::mir::{
59 Body, BorrowKind, FakeBorrowKind, MutBorrowKind, Place, PlaceElem, PlaceRef, ProjectionElem,
60};
61use rustc_middle::ty::{self, TyCtxt};
62use tracing::{debug, instrument};
63
64use crate::{AccessDepth, ArtificialField, Deep, Overlap, Shallow};
65
66#[derive(#[automatically_derived]
impl ::core::marker::Copy for PlaceConflictBias { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for PlaceConflictBias { }
#[automatically_derived]
impl ::core::clone::Clone for PlaceConflictBias {
#[inline]
fn clone(&self) -> PlaceConflictBias { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for PlaceConflictBias {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
PlaceConflictBias::Overlap => "Overlap",
PlaceConflictBias::NoOverlap => "NoOverlap",
})
}
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for PlaceConflictBias {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for PlaceConflictBias { }
#[automatically_derived]
impl ::core::cmp::PartialEq for PlaceConflictBias {
#[inline]
fn eq(&self, other: &PlaceConflictBias) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq)]
73pub enum PlaceConflictBias {
74 Overlap,
75 NoOverlap,
76}
77
78pub fn places_conflict<'tcx>(
82 tcx: TyCtxt<'tcx>,
83 body: &Body<'tcx>,
84 borrow_place: Place<'tcx>,
85 access_place: Place<'tcx>,
86 bias: PlaceConflictBias,
87) -> bool {
88 borrow_conflicts_with_place(
89 tcx,
90 body,
91 borrow_place,
92 BorrowKind::Mut { kind: MutBorrowKind::TwoPhaseBorrow },
93 access_place.as_ref(),
94 AccessDepth::Deep,
95 bias,
96 )
97}
98
99#[inline]
104pub(super) fn borrow_conflicts_with_place<'tcx>(
105 tcx: TyCtxt<'tcx>,
106 body: &Body<'tcx>,
107 borrow_place: Place<'tcx>,
108 borrow_kind: BorrowKind,
109 access_place: PlaceRef<'tcx>,
110 access: AccessDepth,
111 bias: PlaceConflictBias,
112) -> bool {
113 let borrow_local = borrow_place.local;
114 let access_local = access_place.local;
115
116 if borrow_local != access_local {
117 return false;
119 }
120
121 if borrow_place.projection.is_empty() && access_place.projection.is_empty() {
124 return true;
125 }
126
127 place_components_conflict(tcx, body, borrow_place, borrow_kind, access_place, access, bias)
128}
129
130{}
#[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("place_components_conflict",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(130u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("borrow_place")
}> =
::tracing::__macro_support::FieldName::new("borrow_place");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("borrow_kind")
}> =
::tracing::__macro_support::FieldName::new("borrow_kind");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("access_place")
}> =
::tracing::__macro_support::FieldName::new("access_place");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("access")
}> =
::tracing::__macro_support::FieldName::new("access");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("bias")
}> =
::tracing::__macro_support::FieldName::new("bias");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&borrow_place)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&borrow_kind)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&access_place)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&access)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&bias)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: bool = loop {};
return __tracing_attr_fake_return;
}
{
let borrow_local = borrow_place.local;
let access_local = access_place.local;
{
match (&borrow_local, &access_local) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
let kind = ::core::panicking::AssertKind::Eq;
::core::panicking::assert_failed(kind, &*left_val,
&*right_val, ::core::option::Option::None);
}
}
}
};
for ((borrow_place, borrow_c), &access_c) in
iter::zip(borrow_place.iter_projections(),
access_place.projection) {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:149",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(149u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("borrow_c")
}> =
::tracing::__macro_support::FieldName::new("borrow_c");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("access_c")
}> =
::tracing::__macro_support::FieldName::new("access_c");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&borrow_c)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&access_c)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
match place_projection_conflict(tcx, body, borrow_place,
borrow_c, access_c, bias) {
Overlap::Arbitrary => {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:178",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(178u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("arbitrary -> conflict")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
return true;
}
Overlap::EqualOrDisjoint => {}
Overlap::Disjoint => {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:187",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(187u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("disjoint")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
return false;
}
}
}
if borrow_place.projection.len() > access_place.projection.len() {
for (base, elem) in
borrow_place.iter_projections().skip(access_place.projection.len())
{
let base_ty = base.ty(body, tcx).ty;
match (elem, base_ty.kind(), access) {
(_, _, Shallow(Some(ArtificialField::ArrayLength))) |
(_, _, Shallow(Some(ArtificialField::FakeBorrow))) => {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:215",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(215u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("borrow_conflicts_with_place: implicit field")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
return false;
}
(ProjectionElem::Deref, _, Shallow(None)) => {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:223",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(223u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("borrow_conflicts_with_place: shallow access behind ptr")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
return false;
}
(ProjectionElem::Deref, ty::Ref(_, _, hir::Mutability::Not),
_) => {
::rustc_middle::util::bug::bug_fmt(format_args!("Tracking borrow behind shared reference."));
}
(ProjectionElem::Deref, ty::Ref(_, _, hir::Mutability::Mut),
AccessDepth::Drop) => {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:233",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(233u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("borrow_conflicts_with_place: drop access behind ptr")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
return false;
}
(ProjectionElem::PhantomDeref, _, Shallow(None)) => {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:240",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(240u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("borrow_conflicts_with_place: shallow access behind reborrow")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
return false;
}
(ProjectionElem::Field { .. }, ty::Adt(def, _),
AccessDepth::Drop) => {
if def.has_dtor(tcx) { return true; }
}
(ProjectionElem::Deref, _, Deep) |
(ProjectionElem::Deref, _, AccessDepth::Drop) |
(ProjectionElem::PhantomDeref, _, _) |
(ProjectionElem::Field { .. }, _, _) |
(ProjectionElem::Index { .. }, _, _) |
(ProjectionElem::ConstantIndex { .. }, _, _) |
(ProjectionElem::Subslice { .. }, _, _) |
(ProjectionElem::OpaqueCast { .. }, _, _) |
(ProjectionElem::Downcast { .. }, _, _) |
(ProjectionElem::UnwrapUnsafeBinder(_), _, _) => {}
}
}
}
if borrow_kind == BorrowKind::Fake(FakeBorrowKind::Shallow) &&
borrow_place.projection.len() <
access_place.projection.len() {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:287",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(287u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("borrow_conflicts_with_place: shallow borrow")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
false
} else {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:290",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(290u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("borrow_conflicts_with_place: full borrow, CONFLICT")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
true
}
}
}
}#[instrument(level = "debug", skip(tcx, body))]
131fn place_components_conflict<'tcx>(
132 tcx: TyCtxt<'tcx>,
133 body: &Body<'tcx>,
134 borrow_place: Place<'tcx>,
135 borrow_kind: BorrowKind,
136 access_place: PlaceRef<'tcx>,
137 access: AccessDepth,
138 bias: PlaceConflictBias,
139) -> bool {
140 let borrow_local = borrow_place.local;
141 let access_local = access_place.local;
142 assert_eq!(borrow_local, access_local);
144
145 for ((borrow_place, borrow_c), &access_c) in
147 iter::zip(borrow_place.iter_projections(), access_place.projection)
148 {
149 debug!(?borrow_c, ?access_c);
150
151 match place_projection_conflict(tcx, body, borrow_place, borrow_c, access_c, bias) {
164 Overlap::Arbitrary => {
165 debug!("arbitrary -> conflict");
179 return true;
180 }
181 Overlap::EqualOrDisjoint => {
182 }
184 Overlap::Disjoint => {
185 debug!("disjoint");
188 return false;
189 }
190 }
191 }
192
193 if borrow_place.projection.len() > access_place.projection.len() {
194 for (base, elem) in borrow_place.iter_projections().skip(access_place.projection.len()) {
195 let base_ty = base.ty(body, tcx).ty;
204
205 match (elem, base_ty.kind(), access) {
206 (_, _, Shallow(Some(ArtificialField::ArrayLength)))
207 | (_, _, Shallow(Some(ArtificialField::FakeBorrow))) => {
208 debug!("borrow_conflicts_with_place: implicit field");
216 return false;
217 }
218
219 (ProjectionElem::Deref, _, Shallow(None)) => {
220 debug!("borrow_conflicts_with_place: shallow access behind ptr");
224 return false;
225 }
226 (ProjectionElem::Deref, ty::Ref(_, _, hir::Mutability::Not), _) => {
227 bug!("Tracking borrow behind shared reference.");
229 }
230 (ProjectionElem::Deref, ty::Ref(_, _, hir::Mutability::Mut), AccessDepth::Drop) => {
231 debug!("borrow_conflicts_with_place: drop access behind ptr");
234 return false;
235 }
236
237 (ProjectionElem::PhantomDeref, _, Shallow(None)) => {
238 debug!("borrow_conflicts_with_place: shallow access behind reborrow");
241 return false;
242 }
243
244 (ProjectionElem::Field { .. }, ty::Adt(def, _), AccessDepth::Drop) => {
245 if def.has_dtor(tcx) {
248 return true;
249 }
250 }
251
252 (ProjectionElem::Deref, _, Deep)
253 | (ProjectionElem::Deref, _, AccessDepth::Drop)
254 | (ProjectionElem::PhantomDeref, _, _)
255 | (ProjectionElem::Field { .. }, _, _)
256 | (ProjectionElem::Index { .. }, _, _)
257 | (ProjectionElem::ConstantIndex { .. }, _, _)
258 | (ProjectionElem::Subslice { .. }, _, _)
259 | (ProjectionElem::OpaqueCast { .. }, _, _)
260 | (ProjectionElem::Downcast { .. }, _, _)
261 | (ProjectionElem::UnwrapUnsafeBinder(_), _, _) => {
262 }
267 }
268 }
269 }
270
271 if borrow_kind == BorrowKind::Fake(FakeBorrowKind::Shallow)
285 && borrow_place.projection.len() < access_place.projection.len()
286 {
287 debug!("borrow_conflicts_with_place: shallow borrow");
288 false
289 } else {
290 debug!("borrow_conflicts_with_place: full borrow, CONFLICT");
291 true
292 }
293}
294
295fn place_projection_conflict<'tcx>(
299 tcx: TyCtxt<'tcx>,
300 body: &Body<'tcx>,
301 pi1: PlaceRef<'tcx>,
302 pi1_elem: PlaceElem<'tcx>,
303 pi2_elem: PlaceElem<'tcx>,
304 bias: PlaceConflictBias,
305) -> Overlap {
306 match (pi1_elem, pi2_elem) {
307 (ProjectionElem::Deref, ProjectionElem::Deref) => {
308 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:309",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(309u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-DEREF")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-DEREF");
310 Overlap::EqualOrDisjoint
311 }
312 (ProjectionElem::PhantomDeref, ProjectionElem::PhantomDeref) => {
313 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:314",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(314u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-PHANTOM-DEREF")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-PHANTOM-DEREF");
315 Overlap::EqualOrDisjoint
316 }
317 (ProjectionElem::OpaqueCast(_), ProjectionElem::OpaqueCast(_)) => {
318 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:319",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(319u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-OPAQUE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-OPAQUE");
320 Overlap::EqualOrDisjoint
321 }
322 (ProjectionElem::Field(f1, _), ProjectionElem::Field(f2, _)) => {
323 if f1 == f2 {
324 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:325",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(325u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-FIELD")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-FIELD");
326 Overlap::EqualOrDisjoint
327 } else {
328 let ty = pi1.ty(body, tcx).ty;
329 if ty.is_union() {
330 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:331",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(331u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: STUCK-UNION")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: STUCK-UNION");
332 Overlap::Arbitrary
333 } else {
334 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:335",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(335u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-FIELD")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-FIELD");
336 Overlap::Disjoint
337 }
338 }
339 }
340 (ProjectionElem::Downcast(_, v1), ProjectionElem::Downcast(_, v2)) => {
341 if v1 == v2 {
366 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:366",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(366u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-FIELD")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-FIELD");
367 Overlap::EqualOrDisjoint
368 } else {
369 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:369",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(369u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-FIELD")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-FIELD");
370 Overlap::Disjoint
371 }
372 }
373 (
374 ProjectionElem::Index(..),
375 ProjectionElem::Index(..)
376 | ProjectionElem::ConstantIndex { .. }
377 | ProjectionElem::Subslice { .. },
378 )
379 | (
380 ProjectionElem::ConstantIndex { .. } | ProjectionElem::Subslice { .. },
381 ProjectionElem::Index(..),
382 ) => {
383 match bias {
386 PlaceConflictBias::Overlap => {
387 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:389",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(389u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-INDEX")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-INDEX");
390 Overlap::EqualOrDisjoint
391 }
392 PlaceConflictBias::NoOverlap => {
393 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:394",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(394u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-ARRAY-INDEX")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-ARRAY-INDEX");
395 Overlap::Disjoint
396 }
397 }
398 }
399 (
400 ProjectionElem::ConstantIndex { offset: o1, min_length: _, from_end: false },
401 ProjectionElem::ConstantIndex { offset: o2, min_length: _, from_end: false },
402 )
403 | (
404 ProjectionElem::ConstantIndex { offset: o1, min_length: _, from_end: true },
405 ProjectionElem::ConstantIndex { offset: o2, min_length: _, from_end: true },
406 ) => {
407 if o1 == o2 {
408 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:408",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(408u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX");
409 Overlap::EqualOrDisjoint
410 } else {
411 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:411",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(411u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX");
412 Overlap::Disjoint
413 }
414 }
415 (
416 ProjectionElem::ConstantIndex {
417 offset: offset_from_begin,
418 min_length: min_length1,
419 from_end: false,
420 },
421 ProjectionElem::ConstantIndex {
422 offset: offset_from_end,
423 min_length: min_length2,
424 from_end: true,
425 },
426 )
427 | (
428 ProjectionElem::ConstantIndex {
429 offset: offset_from_end,
430 min_length: min_length1,
431 from_end: true,
432 },
433 ProjectionElem::ConstantIndex {
434 offset: offset_from_begin,
435 min_length: min_length2,
436 from_end: false,
437 },
438 ) => {
439 let min_length = max(min_length1, min_length2);
441 if offset_from_begin >= min_length - offset_from_end {
446 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:446",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(446u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-FE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-FE");
447 Overlap::EqualOrDisjoint
448 } else {
449 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:449",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(449u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-FE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-FE");
450 Overlap::Disjoint
451 }
452 }
453 (
454 ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false },
455 ProjectionElem::Subslice { from, to, from_end: false },
456 )
457 | (
458 ProjectionElem::Subslice { from, to, from_end: false },
459 ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false },
460 ) => {
461 if (from..to).contains(&offset) {
462 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:462",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(462u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE");
463 Overlap::EqualOrDisjoint
464 } else {
465 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:465",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(465u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE");
466 Overlap::Disjoint
467 }
468 }
469 (
470 ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false },
471 ProjectionElem::Subslice { from, .. },
472 )
473 | (
474 ProjectionElem::Subslice { from, .. },
475 ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false },
476 ) => {
477 if offset >= from {
478 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:478",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(478u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-SLICE-CONSTANT-INDEX-SUBSLICE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-SLICE-CONSTANT-INDEX-SUBSLICE");
479 Overlap::EqualOrDisjoint
480 } else {
481 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:481",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(481u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-SLICE-CONSTANT-INDEX-SUBSLICE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-SLICE-CONSTANT-INDEX-SUBSLICE");
482 Overlap::Disjoint
483 }
484 }
485 (
486 ProjectionElem::ConstantIndex { offset, min_length: _, from_end: true },
487 ProjectionElem::Subslice { to, from_end: true, .. },
488 )
489 | (
490 ProjectionElem::Subslice { to, from_end: true, .. },
491 ProjectionElem::ConstantIndex { offset, min_length: _, from_end: true },
492 ) => {
493 if offset > to {
494 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:494",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(494u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-SLICE-CONSTANT-INDEX-SUBSLICE-FE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!(
495 "place_element_conflict: \
496 DISJOINT-OR-EQ-SLICE-CONSTANT-INDEX-SUBSLICE-FE"
497 );
498 Overlap::EqualOrDisjoint
499 } else {
500 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:500",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(500u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-SLICE-CONSTANT-INDEX-SUBSLICE-FE")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-SLICE-CONSTANT-INDEX-SUBSLICE-FE");
501 Overlap::Disjoint
502 }
503 }
504 (
505 ProjectionElem::Subslice { from: f1, to: t1, from_end: false },
506 ProjectionElem::Subslice { from: f2, to: t2, from_end: false },
507 ) => {
508 if f2 >= t1 || f1 >= t2 {
509 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:509",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(509u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-ARRAY-SUBSLICES")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-ARRAY-SUBSLICES");
510 Overlap::Disjoint
511 } else {
512 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:512",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(512u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-SUBSLICES")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-SUBSLICES");
513 Overlap::EqualOrDisjoint
514 }
515 }
516 (ProjectionElem::Subslice { .. }, ProjectionElem::Subslice { .. }) => {
517 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event /rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs:517",
"rustc_borrowck::places_conflict", ::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("/rustc-dev/a69a63265cfd9e006d43137f98301b8d274ad4c9/compiler/rustc_borrowck/src/places_conflict.rs"),
::tracing_core::__macro_support::Option::Some(517u32),
::tracing_core::__macro_support::Option::Some("rustc_borrowck::places_conflict"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("place_element_conflict: DISJOINT-OR-EQ-SLICE-SUBSLICES")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!("place_element_conflict: DISJOINT-OR-EQ-SLICE-SUBSLICES");
518 Overlap::EqualOrDisjoint
519 }
520 (
521 ProjectionElem::Deref
522 | ProjectionElem::PhantomDeref
523 | ProjectionElem::Field(..)
524 | ProjectionElem::Index(..)
525 | ProjectionElem::ConstantIndex { .. }
526 | ProjectionElem::OpaqueCast { .. }
527 | ProjectionElem::Subslice { .. }
528 | ProjectionElem::Downcast(..),
529 _,
530 ) => ::rustc_middle::util::bug::bug_fmt(format_args!("mismatched projections in place_element_conflict: {0:?} and {1:?}",
pi1_elem, pi2_elem))bug!(
531 "mismatched projections in place_element_conflict: {:?} and {:?}",
532 pi1_elem,
533 pi2_elem
534 ),
535
536 (ProjectionElem::UnwrapUnsafeBinder(_), _) => {
537 ::core::panicking::panic("not implemented")unimplemented!()
538 }
539 }
540}