use rustc_span::Span;
impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
- crate fn cannot_move_when_borrowed(
+ pub(crate) fn cannot_move_when_borrowed(
&self,
span: Span,
desc: &str,
struct_span_err!(self, span, E0505, "cannot move out of {} because it is borrowed", desc,)
}
- crate fn cannot_use_when_mutably_borrowed(
+ pub(crate) fn cannot_use_when_mutably_borrowed(
&self,
span: Span,
desc: &str,
err
}
- crate fn cannot_act_on_uninitialized_variable(
+ pub(crate) fn cannot_act_on_uninitialized_variable(
&self,
span: Span,
verb: &str,
)
}
- crate fn cannot_mutably_borrow_multiply(
+ pub(crate) fn cannot_mutably_borrow_multiply(
&self,
new_loan_span: Span,
desc: &str,
err
}
- crate fn cannot_uniquely_borrow_by_two_closures(
+ pub(crate) fn cannot_uniquely_borrow_by_two_closures(
&self,
new_loan_span: Span,
desc: &str,
err
}
- crate fn cannot_uniquely_borrow_by_one_closure(
+ pub(crate) fn cannot_uniquely_borrow_by_one_closure(
&self,
new_loan_span: Span,
container_name: &str,
err
}
- crate fn cannot_reborrow_already_uniquely_borrowed(
+ pub(crate) fn cannot_reborrow_already_uniquely_borrowed(
&self,
new_loan_span: Span,
container_name: &str,
err
}
- crate fn cannot_reborrow_already_borrowed(
+ pub(crate) fn cannot_reborrow_already_borrowed(
&self,
span: Span,
desc_new: &str,
err
}
- crate fn cannot_assign_to_borrowed(
+ pub(crate) fn cannot_assign_to_borrowed(
&self,
span: Span,
borrow_span: Span,
err
}
- crate fn cannot_reassign_immutable(
+ pub(crate) fn cannot_reassign_immutable(
&self,
span: Span,
desc: &str,
struct_span_err!(self, span, E0384, "cannot assign {} {}", msg, desc)
}
- crate fn cannot_assign(
+ pub(crate) fn cannot_assign(
&self,
span: Span,
desc: &str,
struct_span_err!(self, span, E0594, "cannot assign to {}", desc)
}
- crate fn cannot_move_out_of(
+ pub(crate) fn cannot_move_out_of(
&self,
move_from_span: Span,
move_from_desc: &str,
/// Signal an error due to an attempt to move out of the interior
/// of an array or slice. `is_index` is None when error origin
/// didn't capture whether there was an indexing operation or not.
- crate fn cannot_move_out_of_interior_noncopy(
+ pub(crate) fn cannot_move_out_of_interior_noncopy(
&self,
move_from_span: Span,
ty: Ty<'_>,
err
}
- crate fn cannot_move_out_of_interior_of_drop(
+ pub(crate) fn cannot_move_out_of_interior_of_drop(
&self,
move_from_span: Span,
container_ty: Ty<'_>,
err
}
- crate fn cannot_act_on_moved_value(
+ pub(crate) fn cannot_act_on_moved_value(
&self,
use_span: Span,
verb: &str,
)
}
- crate fn cannot_borrow_path_as_mutable_because(
+ pub(crate) fn cannot_borrow_path_as_mutable_because(
&self,
span: Span,
path: &str,
struct_span_err!(self, span, E0596, "cannot borrow {} as mutable{}", path, reason,)
}
- crate fn cannot_mutate_in_immutable_section(
+ pub(crate) fn cannot_mutate_in_immutable_section(
&self,
mutate_span: Span,
immutable_span: Span,
err
}
- crate fn cannot_borrow_across_generator_yield(
+ pub(crate) fn cannot_borrow_across_generator_yield(
&self,
span: Span,
yield_span: Span,
err
}
- crate fn cannot_borrow_across_destructor(
+ pub(crate) fn cannot_borrow_across_destructor(
&self,
borrow_span: Span,
) -> DiagnosticBuilder<'cx, ErrorGuaranteed> {
)
}
- crate fn path_does_not_live_long_enough(
+ pub(crate) fn path_does_not_live_long_enough(
&self,
span: Span,
path: &str,
struct_span_err!(self, span, E0597, "{} does not live long enough", path,)
}
- crate fn cannot_return_reference_to_local(
+ pub(crate) fn cannot_return_reference_to_local(
&self,
span: Span,
return_kind: &str,
err
}
- crate fn cannot_capture_in_long_lived_closure(
+ pub(crate) fn cannot_capture_in_long_lived_closure(
&self,
closure_span: Span,
closure_kind: &str,
err
}
- crate fn thread_local_value_does_not_live_long_enough(
+ pub(crate) fn thread_local_value_does_not_live_long_enough(
&self,
span: Span,
) -> DiagnosticBuilder<'cx, ErrorGuaranteed> {
struct_span_err!(self, span, E0712, "thread-local variable borrowed past end of function",)
}
- crate fn temporary_value_borrowed_for_too_long(
+ pub(crate) fn temporary_value_borrowed_for_too_long(
&self,
span: Span,
) -> DiagnosticBuilder<'cx, ErrorGuaranteed> {
}
}
-crate fn borrowed_data_escapes_closure<'tcx>(
+pub(crate) fn borrowed_data_escapes_closure<'tcx>(
tcx: TyCtxt<'tcx>,
escape_span: Span,
escapes_from: &str,