Skip to content

Commit

Permalink
Remove unused BorrowckErrors methods
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Jul 14, 2019
1 parent 85a360e commit 2975c01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 108 deletions.
6 changes: 3 additions & 3 deletions src/librustc_mir/error_codes.rs
Expand Up @@ -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
}
105 changes: 0 additions & 105 deletions src/librustc_mir/util/borrowck_errors.rs
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2975c01

Please sign in to comment.