diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2019-07-12 19:59:25 +0100 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2019-07-14 20:19:16 +0100 |
| commit | 2975c01747fd112812a13637103d7e8e2df46419 (patch) | |
| tree | 71ee878180a358498108e01fa5fe84553022d1d8 | |
| parent | 85a360e0ea2f1629b8851e7c9b2903bbdbab42bf (diff) | |
| download | rust-2975c01747fd112812a13637103d7e8e2df46419.tar.gz rust-2975c01747fd112812a13637103d7e8e2df46419.zip | |
Remove unused BorrowckErrors methods
| -rw-r--r-- | src/librustc_mir/error_codes.rs | 6 | ||||
| -rw-r--r-- | src/librustc_mir/util/borrowck_errors.rs | 105 |
2 files changed, 3 insertions, 108 deletions
diff --git a/src/librustc_mir/error_codes.rs b/src/librustc_mir/error_codes.rs index 618c047e773..83d441b90be 100644 --- a/src/librustc_mir/error_codes.rs +++ b/src/librustc_mir/error_codes.rs @@ -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 } diff --git a/src/librustc_mir/util/borrowck_errors.rs b/src/librustc_mir/util/borrowck_errors.rs index bce6761e2ca..7c7e4de316f 100644 --- a/src/librustc_mir/util/borrowck_errors.rs +++ b/src/librustc_mir/util/borrowck_errors.rs @@ -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, |
