Skip to content

Commit 2975c01

Browse files
committed
Remove unused BorrowckErrors methods
1 parent 85a360e commit 2975c01

File tree

2 files changed

+3
-108
lines changed

2 files changed

+3
-108
lines changed

Diff for: src/librustc_mir/error_codes.rs

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

Diff for: src/librustc_mir/util/borrowck_errors.rs

-105
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
300300
err
301301
}
302302

303-
fn cannot_move_into_closure(self, span: Span, desc: &str, _: Origin) -> DiagnosticBuilder<'cx> {
304-
struct_span_err!(
305-
self,
306-
span,
307-
E0504,
308-
"cannot move `{}` into closure because it is borrowed",
309-
desc,
310-
)
311-
}
312-
313303
fn cannot_reassign_immutable(
314304
self,
315305
span: Span,
@@ -336,10 +326,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
336326
struct_span_err!(self, span, E0594, "cannot assign to {}", desc)
337327
}
338328

339-
fn cannot_assign_static(self, span: Span, desc: &str, o: Origin) -> DiagnosticBuilder<'cx> {
340-
self.cannot_assign(span, &format!("immutable static item `{}`", desc), o)
341-
}
342-
343329
fn cannot_move_out_of(
344330
self,
345331
move_from_span: Span,
@@ -422,36 +408,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
422408
)
423409
}
424410

425-
fn cannot_partially_reinit_an_uninit_struct(
426-
self,
427-
span: Span,
428-
uninit_path: &str,
429-
_: Origin,
430-
) -> DiagnosticBuilder<'cx> {
431-
struct_span_err!(
432-
self,
433-
span,
434-
E0383,
435-
"partial reinitialization of uninitialized structure `{}`",
436-
uninit_path,
437-
)
438-
}
439-
440-
fn closure_cannot_assign_to_borrowed(
441-
self,
442-
span: Span,
443-
descr: &str,
444-
_: Origin,
445-
) -> DiagnosticBuilder<'cx> {
446-
struct_span_err!(
447-
self,
448-
span,
449-
E0595,
450-
"closure cannot assign to {}",
451-
descr,
452-
)
453-
}
454-
455411
fn cannot_borrow_path_as_mutable_because(
456412
self,
457413
span: Span,
@@ -469,15 +425,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
469425
)
470426
}
471427

472-
fn cannot_borrow_path_as_mutable(
473-
self,
474-
span: Span,
475-
path: &str,
476-
o: Origin,
477-
) -> DiagnosticBuilder<'cx> {
478-
self.cannot_borrow_path_as_mutable_because(span, path, "", o)
479-
}
480-
481428
fn cannot_mutate_in_match_guard(
482429
self,
483430
mutate_span: Span,
@@ -569,58 +516,6 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
569516
err
570517
}
571518

572-
fn lifetime_too_short_for_reborrow(
573-
self,
574-
span: Span,
575-
path: &str,
576-
_: Origin,
577-
) -> DiagnosticBuilder<'cx> {
578-
struct_span_err!(
579-
self,
580-
span,
581-
E0598,
582-
"lifetime of {} is too short to guarantee \
583-
its contents can be safely reborrowed",
584-
path,
585-
)
586-
}
587-
588-
fn cannot_act_on_capture_in_sharable_fn(
589-
self,
590-
span: Span,
591-
bad_thing: &str,
592-
help: (Span, &str),
593-
_: Origin,
594-
) -> DiagnosticBuilder<'cx> {
595-
let (help_span, help_msg) = help;
596-
let mut err = struct_span_err!(
597-
self,
598-
span,
599-
E0387,
600-
"{} in a captured outer variable in an `Fn` closure",
601-
bad_thing,
602-
);
603-
err.span_help(help_span, help_msg);
604-
err
605-
}
606-
607-
fn cannot_assign_into_immutable_reference(
608-
self,
609-
span: Span,
610-
bad_thing: &str,
611-
_: Origin,
612-
) -> DiagnosticBuilder<'cx> {
613-
let mut err = struct_span_err!(
614-
self,
615-
span,
616-
E0389,
617-
"{} in a `&` reference",
618-
bad_thing,
619-
);
620-
err.span_label(span, "assignment into an immutable reference");
621-
err
622-
}
623-
624519
fn cannot_capture_in_long_lived_closure(
625520
self,
626521
closure_span: Span,

0 commit comments

Comments
 (0)