fix imports
This commit is contained in:
parent
07a0486228
commit
67560976b4
6 changed files with 33 additions and 27 deletions
|
@ -14,18 +14,21 @@ use rustc_errors::{Applicability, DiagnosticBuilder};
|
|||
use syntax_pos::Span;
|
||||
use syntax::source_map::DesugaringKind;
|
||||
|
||||
use super::nll::explain_borrow::BorrowExplanation;
|
||||
use super::nll::region_infer::{RegionName, RegionNameSource};
|
||||
use super::prefixes::IsPrefixOf;
|
||||
use super::WriteKind;
|
||||
use super::borrow_set::BorrowData;
|
||||
use super::MirBorrowckCtxt;
|
||||
use super::{InitializationRequiringAction, PrefixSet};
|
||||
use super::error_reporting::{IncludingDowncast, UseSpans};
|
||||
use crate::dataflow::drop_flag_effects;
|
||||
use crate::dataflow::indexes::{MovePathIndex, MoveOutIndex};
|
||||
use crate::util::borrowck_errors;
|
||||
|
||||
use crate::borrow_check::{
|
||||
nll::explain_borrow::BorrowExplanation,
|
||||
nll::region_infer::{RegionName, RegionNameSource},
|
||||
prefixes::IsPrefixOf,
|
||||
WriteKind,
|
||||
borrow_set::BorrowData,
|
||||
MirBorrowckCtxt, InitializationRequiringAction, PrefixSet
|
||||
};
|
||||
|
||||
use super::{IncludingDowncast, UseSpans};
|
||||
|
||||
#[derive(Debug)]
|
||||
struct MoveSite {
|
||||
/// Index of the "move out" that we found. The `MoveData` can
|
||||
|
@ -46,7 +49,7 @@ enum StorageDeadOrDrop<'tcx> {
|
|||
}
|
||||
|
||||
impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||
pub(super) fn report_use_of_moved_or_uninitialized(
|
||||
pub(in crate::borrow_check) fn report_use_of_moved_or_uninitialized(
|
||||
&mut self,
|
||||
location: Location,
|
||||
desired_action: InitializationRequiringAction,
|
||||
|
@ -269,7 +272,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub(super) fn report_move_out_while_borrowed(
|
||||
pub(in crate::borrow_check) fn report_move_out_while_borrowed(
|
||||
&mut self,
|
||||
location: Location,
|
||||
(place, span): (&Place<'tcx>, Span),
|
||||
|
@ -326,7 +329,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
err.buffer(&mut self.errors_buffer);
|
||||
}
|
||||
|
||||
pub(super) fn report_use_while_mutably_borrowed(
|
||||
pub(in crate::borrow_check) fn report_use_while_mutably_borrowed(
|
||||
&mut self,
|
||||
location: Location,
|
||||
(place, _span): (&Place<'tcx>, Span),
|
||||
|
@ -368,7 +371,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
err
|
||||
}
|
||||
|
||||
pub(super) fn report_conflicting_borrow(
|
||||
pub(in crate::borrow_check) fn report_conflicting_borrow(
|
||||
&mut self,
|
||||
location: Location,
|
||||
(place, span): (&Place<'tcx>, Span),
|
||||
|
@ -614,7 +617,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
///
|
||||
/// > cannot borrow `a.u` (via `a.u.z.c`) as immutable because it is also borrowed as
|
||||
/// > mutable (via `a.u.s.b`) [E0502]
|
||||
pub(super) fn describe_place_for_conflicting_borrow(
|
||||
pub(in crate::borrow_check) fn describe_place_for_conflicting_borrow(
|
||||
&self,
|
||||
first_borrowed_place: &Place<'tcx>,
|
||||
second_borrowed_place: &Place<'tcx>,
|
||||
|
@ -722,7 +725,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
/// short a lifetime. (But sometimes it is more useful to report
|
||||
/// it as a more direct conflict between the execution of a
|
||||
/// `Drop::drop` with an aliasing borrow.)
|
||||
pub(super) fn report_borrowed_value_does_not_live_long_enough(
|
||||
pub(in crate::borrow_check) fn report_borrowed_value_does_not_live_long_enough(
|
||||
&mut self,
|
||||
location: Location,
|
||||
borrow: &BorrowData<'tcx>,
|
||||
|
@ -1478,7 +1481,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
result
|
||||
}
|
||||
|
||||
pub(super) fn report_illegal_mutation_of_borrowed(
|
||||
pub(in crate::borrow_check) fn report_illegal_mutation_of_borrowed(
|
||||
&mut self,
|
||||
location: Location,
|
||||
(place, span): (&Place<'tcx>, Span),
|
||||
|
@ -1537,7 +1540,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
/// assigned; `err_place` is a place providing a reason why
|
||||
/// `place` is not mutable (e.g., the non-`mut` local `x` in an
|
||||
/// assignment to `x.f`).
|
||||
pub(super) fn report_illegal_reassignment(
|
||||
pub(in crate::borrow_check) fn report_illegal_reassignment(
|
||||
&mut self,
|
||||
_location: Location,
|
||||
(place, span): (&Place<'tcx>, Span),
|
||||
|
@ -2080,7 +2083,7 @@ enum AnnotatedBorrowFnSignature<'tcx> {
|
|||
impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
|
||||
/// Annotate the provided diagnostic with information about borrow from the fn signature that
|
||||
/// helps explain.
|
||||
pub(super) fn emit(
|
||||
pub(in crate::borrow_check) fn emit(
|
||||
&self,
|
||||
cx: &mut MirBorrowckCtxt<'_, 'tcx>,
|
||||
diag: &mut DiagnosticBuilder<'_>,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//! Borrow checker diagnostics.
|
||||
|
||||
use rustc::hir;
|
||||
use rustc::hir::def::Namespace;
|
||||
use rustc::hir::def_id::DefId;
|
||||
|
@ -17,6 +19,10 @@ use super::borrow_set::BorrowData;
|
|||
use super::MirBorrowckCtxt;
|
||||
use crate::dataflow::move_paths::{InitLocation, LookupResult};
|
||||
|
||||
crate mod conflict_errors;
|
||||
crate mod move_errors;
|
||||
crate mod mutability_errors;
|
||||
|
||||
pub(super) struct IncludingDowncast(pub(super) bool);
|
||||
|
||||
impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||
|
|
|
@ -5,7 +5,7 @@ use syntax_pos::Span;
|
|||
|
||||
use crate::borrow_check::MirBorrowckCtxt;
|
||||
use crate::borrow_check::prefixes::PrefixSet;
|
||||
use crate::borrow_check::error_reporting::UseSpans;
|
||||
use crate::borrow_check::diagnostics::UseSpans;
|
||||
use crate::dataflow::move_paths::{
|
||||
IllegalMoveOrigin, IllegalMoveOriginKind,
|
||||
LookupResult, MoveError, MovePathIndex,
|
||||
|
|
|
@ -8,18 +8,18 @@ use syntax_pos::Span;
|
|||
use syntax_pos::symbol::kw;
|
||||
|
||||
use crate::borrow_check::MirBorrowckCtxt;
|
||||
use crate::borrow_check::error_reporting::BorrowedContentSource;
|
||||
use crate::borrow_check::diagnostics::BorrowedContentSource;
|
||||
use crate::util::collect_writes::FindAssignments;
|
||||
use rustc_errors::Applicability;
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub(super) enum AccessKind {
|
||||
pub(crate) enum AccessKind {
|
||||
MutableBorrow,
|
||||
Mutate,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||
pub(super) fn report_mutability_error(
|
||||
pub(crate) fn report_mutability_error(
|
||||
&mut self,
|
||||
access_place: &Place<'tcx>,
|
||||
span: Span,
|
||||
|
|
|
@ -46,17 +46,14 @@ use self::flows::Flows;
|
|||
use self::location::LocationTable;
|
||||
use self::prefixes::PrefixSet;
|
||||
use self::MutateMode::{JustWrite, WriteAndRead};
|
||||
use self::mutability_errors::AccessKind;
|
||||
use self::diagnostics::mutability_errors::AccessKind;
|
||||
|
||||
use self::path_utils::*;
|
||||
|
||||
crate mod borrow_set;
|
||||
mod error_reporting;
|
||||
mod diagnostics;
|
||||
mod flows;
|
||||
mod location;
|
||||
mod conflict_errors;
|
||||
mod move_errors;
|
||||
mod mutability_errors;
|
||||
mod path_utils;
|
||||
crate mod place_ext;
|
||||
crate mod places_conflict;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::collections::VecDeque;
|
||||
|
||||
use crate::borrow_check::borrow_set::BorrowData;
|
||||
use crate::borrow_check::error_reporting::UseSpans;
|
||||
use crate::borrow_check::diagnostics::UseSpans;
|
||||
use crate::borrow_check::nll::region_infer::{Cause, RegionName};
|
||||
use crate::borrow_check::nll::ConstraintDescription;
|
||||
use crate::borrow_check::{MirBorrowckCtxt, WriteKind};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue