Skip to content

Commit 6756097

Browse files
committed
fix imports
1 parent 07a0486 commit 6756097

File tree

6 files changed

+33
-27
lines changed

6 files changed

+33
-27
lines changed

src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs

+20-17
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ use rustc_errors::{Applicability, DiagnosticBuilder};
1414
use syntax_pos::Span;
1515
use syntax::source_map::DesugaringKind;
1616

17-
use super::nll::explain_borrow::BorrowExplanation;
18-
use super::nll::region_infer::{RegionName, RegionNameSource};
19-
use super::prefixes::IsPrefixOf;
20-
use super::WriteKind;
21-
use super::borrow_set::BorrowData;
22-
use super::MirBorrowckCtxt;
23-
use super::{InitializationRequiringAction, PrefixSet};
24-
use super::error_reporting::{IncludingDowncast, UseSpans};
2517
use crate::dataflow::drop_flag_effects;
2618
use crate::dataflow::indexes::{MovePathIndex, MoveOutIndex};
2719
use crate::util::borrowck_errors;
2820

21+
use crate::borrow_check::{
22+
nll::explain_borrow::BorrowExplanation,
23+
nll::region_infer::{RegionName, RegionNameSource},
24+
prefixes::IsPrefixOf,
25+
WriteKind,
26+
borrow_set::BorrowData,
27+
MirBorrowckCtxt, InitializationRequiringAction, PrefixSet
28+
};
29+
30+
use super::{IncludingDowncast, UseSpans};
31+
2932
#[derive(Debug)]
3033
struct MoveSite {
3134
/// Index of the "move out" that we found. The `MoveData` can
@@ -46,7 +49,7 @@ enum StorageDeadOrDrop<'tcx> {
4649
}
4750

4851
impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
49-
pub(super) fn report_use_of_moved_or_uninitialized(
52+
pub(in crate::borrow_check) fn report_use_of_moved_or_uninitialized(
5053
&mut self,
5154
location: Location,
5255
desired_action: InitializationRequiringAction,
@@ -269,7 +272,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
269272
}
270273
}
271274

272-
pub(super) fn report_move_out_while_borrowed(
275+
pub(in crate::borrow_check) fn report_move_out_while_borrowed(
273276
&mut self,
274277
location: Location,
275278
(place, span): (&Place<'tcx>, Span),
@@ -326,7 +329,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
326329
err.buffer(&mut self.errors_buffer);
327330
}
328331

329-
pub(super) fn report_use_while_mutably_borrowed(
332+
pub(in crate::borrow_check) fn report_use_while_mutably_borrowed(
330333
&mut self,
331334
location: Location,
332335
(place, _span): (&Place<'tcx>, Span),
@@ -368,7 +371,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
368371
err
369372
}
370373

371-
pub(super) fn report_conflicting_borrow(
374+
pub(in crate::borrow_check) fn report_conflicting_borrow(
372375
&mut self,
373376
location: Location,
374377
(place, span): (&Place<'tcx>, Span),
@@ -614,7 +617,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
614617
///
615618
/// > cannot borrow `a.u` (via `a.u.z.c`) as immutable because it is also borrowed as
616619
/// > mutable (via `a.u.s.b`) [E0502]
617-
pub(super) fn describe_place_for_conflicting_borrow(
620+
pub(in crate::borrow_check) fn describe_place_for_conflicting_borrow(
618621
&self,
619622
first_borrowed_place: &Place<'tcx>,
620623
second_borrowed_place: &Place<'tcx>,
@@ -722,7 +725,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
722725
/// short a lifetime. (But sometimes it is more useful to report
723726
/// it as a more direct conflict between the execution of a
724727
/// `Drop::drop` with an aliasing borrow.)
725-
pub(super) fn report_borrowed_value_does_not_live_long_enough(
728+
pub(in crate::borrow_check) fn report_borrowed_value_does_not_live_long_enough(
726729
&mut self,
727730
location: Location,
728731
borrow: &BorrowData<'tcx>,
@@ -1478,7 +1481,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14781481
result
14791482
}
14801483

1481-
pub(super) fn report_illegal_mutation_of_borrowed(
1484+
pub(in crate::borrow_check) fn report_illegal_mutation_of_borrowed(
14821485
&mut self,
14831486
location: Location,
14841487
(place, span): (&Place<'tcx>, Span),
@@ -1537,7 +1540,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15371540
/// assigned; `err_place` is a place providing a reason why
15381541
/// `place` is not mutable (e.g., the non-`mut` local `x` in an
15391542
/// assignment to `x.f`).
1540-
pub(super) fn report_illegal_reassignment(
1543+
pub(in crate::borrow_check) fn report_illegal_reassignment(
15411544
&mut self,
15421545
_location: Location,
15431546
(place, span): (&Place<'tcx>, Span),
@@ -2080,7 +2083,7 @@ enum AnnotatedBorrowFnSignature<'tcx> {
20802083
impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
20812084
/// Annotate the provided diagnostic with information about borrow from the fn signature that
20822085
/// helps explain.
2083-
pub(super) fn emit(
2086+
pub(in crate::borrow_check) fn emit(
20842087
&self,
20852088
cx: &mut MirBorrowckCtxt<'_, 'tcx>,
20862089
diag: &mut DiagnosticBuilder<'_>,

src/librustc_mir/borrow_check/diagnostics/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Borrow checker diagnostics.
2+
13
use rustc::hir;
24
use rustc::hir::def::Namespace;
35
use rustc::hir::def_id::DefId;
@@ -17,6 +19,10 @@ use super::borrow_set::BorrowData;
1719
use super::MirBorrowckCtxt;
1820
use crate::dataflow::move_paths::{InitLocation, LookupResult};
1921

22+
crate mod conflict_errors;
23+
crate mod move_errors;
24+
crate mod mutability_errors;
25+
2026
pub(super) struct IncludingDowncast(pub(super) bool);
2127

2228
impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {

src/librustc_mir/borrow_check/diagnostics/move_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use syntax_pos::Span;
55

66
use crate::borrow_check::MirBorrowckCtxt;
77
use crate::borrow_check::prefixes::PrefixSet;
8-
use crate::borrow_check::error_reporting::UseSpans;
8+
use crate::borrow_check::diagnostics::UseSpans;
99
use crate::dataflow::move_paths::{
1010
IllegalMoveOrigin, IllegalMoveOriginKind,
1111
LookupResult, MoveError, MovePathIndex,

src/librustc_mir/borrow_check/diagnostics/mutability_errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ use syntax_pos::Span;
88
use syntax_pos::symbol::kw;
99

1010
use crate::borrow_check::MirBorrowckCtxt;
11-
use crate::borrow_check::error_reporting::BorrowedContentSource;
11+
use crate::borrow_check::diagnostics::BorrowedContentSource;
1212
use crate::util::collect_writes::FindAssignments;
1313
use rustc_errors::Applicability;
1414

1515
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
16-
pub(super) enum AccessKind {
16+
pub(crate) enum AccessKind {
1717
MutableBorrow,
1818
Mutate,
1919
}
2020

2121
impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
22-
pub(super) fn report_mutability_error(
22+
pub(crate) fn report_mutability_error(
2323
&mut self,
2424
access_place: &Place<'tcx>,
2525
span: Span,

src/librustc_mir/borrow_check/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,14 @@ use self::flows::Flows;
4646
use self::location::LocationTable;
4747
use self::prefixes::PrefixSet;
4848
use self::MutateMode::{JustWrite, WriteAndRead};
49-
use self::mutability_errors::AccessKind;
49+
use self::diagnostics::mutability_errors::AccessKind;
5050

5151
use self::path_utils::*;
5252

5353
crate mod borrow_set;
54-
mod error_reporting;
54+
mod diagnostics;
5555
mod flows;
5656
mod location;
57-
mod conflict_errors;
58-
mod move_errors;
59-
mod mutability_errors;
6057
mod path_utils;
6158
crate mod place_ext;
6259
crate mod places_conflict;

src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::collections::VecDeque;
22

33
use crate::borrow_check::borrow_set::BorrowData;
4-
use crate::borrow_check::error_reporting::UseSpans;
4+
use crate::borrow_check::diagnostics::UseSpans;
55
use crate::borrow_check::nll::region_infer::{Cause, RegionName};
66
use crate::borrow_check::nll::ConstraintDescription;
77
use crate::borrow_check::{MirBorrowckCtxt, WriteKind};

0 commit comments

Comments
 (0)