diff options
Diffstat (limited to 'src/librustc_mir/util/borrowck_errors.rs')
| -rw-r--r-- | src/librustc_mir/util/borrowck_errors.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/librustc_mir/util/borrowck_errors.rs b/src/librustc_mir/util/borrowck_errors.rs index 0a53361df6e..7be6241b3f9 100644 --- a/src/librustc_mir/util/borrowck_errors.rs +++ b/src/librustc_mir/util/borrowck_errors.rs @@ -675,6 +675,22 @@ pub trait BorrowckErrors<'cx>: Sized + Copy { self.cancel_if_wrong_origin(err, o) } + + fn thread_local_value_does_not_live_long_enough( + self, + span: Span, + o: Origin, + ) -> DiagnosticBuilder<'cx> { + let err = struct_span_err!( + self, + span, + E0712, + "thread-local variable borrowed past end of function{OGN}", + OGN = o + ); + + self.cancel_if_wrong_origin(err, o) + } } impl<'cx, 'gcx, 'tcx> BorrowckErrors<'cx> for TyCtxt<'cx, 'gcx, 'tcx> { |
