Auto merge of #95280 - InfRandomness:infrandomness/Dtorck_clarification, r=oli-obk

Swap DtorckConstraint to DropckConstraint

This change was made as per suspicion that this struct was never renamed after consistent use of DropCk.

This also clarifies the meaning behind the name of this structure.

Fixes https://github.com/rust-lang/rust/issues/94310
This commit is contained in:
bors
2022-03-25 14:16:13 +00:00
6 changed files with 19 additions and 19 deletions

View File

@@ -143,7 +143,7 @@ impl<'tcx> DropckOutlivesResult<'tcx> {
/// A set of constraints that need to be satisfied in order for
/// a type to be valid for destruction.
#[derive(Clone, Debug, HashStable)]
pub struct DtorckConstraint<'tcx> {
pub struct DropckConstraint<'tcx> {
/// Types that are required to be alive in order for this
/// type to be valid for destruction.
pub outlives: Vec<ty::subst::GenericArg<'tcx>>,
@@ -157,17 +157,17 @@ pub struct DtorckConstraint<'tcx> {
pub overflows: Vec<Ty<'tcx>>,
}
impl<'tcx> DtorckConstraint<'tcx> {
pub fn empty() -> DtorckConstraint<'tcx> {
DtorckConstraint { outlives: vec![], dtorck_types: vec![], overflows: vec![] }
impl<'tcx> DropckConstraint<'tcx> {
pub fn empty() -> DropckConstraint<'tcx> {
DropckConstraint { outlives: vec![], dtorck_types: vec![], overflows: vec![] }
}
}
impl<'tcx> FromIterator<DtorckConstraint<'tcx>> for DtorckConstraint<'tcx> {
fn from_iter<I: IntoIterator<Item = DtorckConstraint<'tcx>>>(iter: I) -> Self {
impl<'tcx> FromIterator<DropckConstraint<'tcx>> for DropckConstraint<'tcx> {
fn from_iter<I: IntoIterator<Item = DropckConstraint<'tcx>>>(iter: I) -> Self {
let mut result = Self::empty();
for DtorckConstraint { outlives, dtorck_types, overflows } in iter {
for DropckConstraint { outlives, dtorck_types, overflows } in iter {
result.outlives.extend(outlives);
result.dtorck_types.extend(dtorck_types);
result.overflows.extend(overflows);