Remove unused BorrowckErrors methods

This commit is contained in:
Matthew Jasper 2019-07-12 19:59:25 +01:00
parent 85a360e0ea
commit 2975c01747
2 changed files with 3 additions and 108 deletions

View file

@ -2462,12 +2462,12 @@ register_diagnostics! {
// E0298, // cannot compare constants
// E0299, // mismatched types between arms
// E0471, // constant evaluation error (in pattern)
// E0385, // {} in an aliasable location
// E0385, // {} in an aliasable location
E0493, // destructors cannot be evaluated at compile-time
E0521, // borrowed data escapes outside of closure
E0521, // borrowed data escapes outside of closure
E0524, // two closures require unique access to `..` at the same time
E0526, // shuffle indices are not constant
E0594, // cannot assign to {}
E0598, // lifetime of {} is too short to guarantee its contents can be...
// E0598, // lifetime of {} is too short to guarantee its contents can be...
E0625, // thread-local statics cannot be accessed at compile-time
}

View file

@ -300,16 +300,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
err
}
fn cannot_move_into_closure(self, span: Span, desc: &str, _: Origin) -> DiagnosticBuilder<'cx> {
struct_span_err!(
self,
span,
E0504,
"cannot move `{}` into closure because it is borrowed",
desc,
)
}
fn cannot_reassign_immutable(
self,
span: Span,
@ -336,10 +326,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
struct_span_err!(self, span, E0594, "cannot assign to {}", desc)
}
fn cannot_assign_static(self, span: Span, desc: &str, o: Origin) -> DiagnosticBuilder<'cx> {
self.cannot_assign(span, &format!("immutable static item `{}`", desc), o)
}
fn cannot_move_out_of(
self,
move_from_span: Span,
@ -422,36 +408,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
)
}
fn cannot_partially_reinit_an_uninit_struct(
self,
span: Span,
uninit_path: &str,
_: Origin,
) -> DiagnosticBuilder<'cx> {
struct_span_err!(
self,
span,
E0383,
"partial reinitialization of uninitialized structure `{}`",
uninit_path,
)
}
fn closure_cannot_assign_to_borrowed(
self,
span: Span,
descr: &str,
_: Origin,
) -> DiagnosticBuilder<'cx> {
struct_span_err!(
self,
span,
E0595,
"closure cannot assign to {}",
descr,
)
}
fn cannot_borrow_path_as_mutable_because(
self,
span: Span,
@ -469,15 +425,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
)
}
fn cannot_borrow_path_as_mutable(
self,
span: Span,
path: &str,
o: Origin,
) -> DiagnosticBuilder<'cx> {
self.cannot_borrow_path_as_mutable_because(span, path, "", o)
}
fn cannot_mutate_in_match_guard(
self,
mutate_span: Span,
@ -569,58 +516,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
err
}
fn lifetime_too_short_for_reborrow(
self,
span: Span,
path: &str,
_: Origin,
) -> DiagnosticBuilder<'cx> {
struct_span_err!(
self,
span,
E0598,
"lifetime of {} is too short to guarantee \
its contents can be safely reborrowed",
path,
)
}
fn cannot_act_on_capture_in_sharable_fn(
self,
span: Span,
bad_thing: &str,
help: (Span, &str),
_: Origin,
) -> DiagnosticBuilder<'cx> {
let (help_span, help_msg) = help;
let mut err = struct_span_err!(
self,
span,
E0387,
"{} in a captured outer variable in an `Fn` closure",
bad_thing,
);
err.span_help(help_span, help_msg);
err
}
fn cannot_assign_into_immutable_reference(
self,
span: Span,
bad_thing: &str,
_: Origin,
) -> DiagnosticBuilder<'cx> {
let mut err = struct_span_err!(
self,
span,
E0389,
"{} in a `&` reference",
bad_thing,
);
err.span_label(span, "assignment into an immutable reference");
err
}
fn cannot_capture_in_long_lived_closure(
self,
closure_span: Span,