From 56096e4bd498bddbeef26f643a9b97a36fd2b961 Mon Sep 17 00:00:00 2001 From: Florian Groult Date: Thu, 6 Jul 2023 11:44:18 +0200 Subject: [PATCH] fix https://github.com/rust-lang/rust/pull/111748 lifetimes for those slices changed to 'static --- creusot/src/ctx.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/creusot/src/ctx.rs b/creusot/src/ctx.rs index 94ff6b456..ac5da2eb3 100644 --- a/creusot/src/ctx.rs +++ b/creusot/src/ctx.rs @@ -225,25 +225,33 @@ impl<'tcx, 'sess> TranslationCtx<'tcx> { } pub(crate) fn crash_and_error(&self, span: Span, msg: &str) -> ! { - self.tcx.sess.span_fatal_with_code(span, msg, DiagnosticId::Error(String::from("creusot"))) + self.tcx.sess.span_fatal_with_code( + span, + msg.to_string(), + DiagnosticId::Error(String::from("creusot")), + ) } pub(crate) fn fatal_error(&self, span: Span, msg: &str) -> DiagnosticBuilder<'tcx, !> { self.tcx.sess.struct_span_fatal_with_code( span, - msg, + msg.to_string(), DiagnosticId::Error(String::from("creusot")), ) } pub(crate) fn error(&self, span: Span, msg: &str) { - self.tcx.sess.span_err_with_code(span, msg, DiagnosticId::Error(String::from("creusot"))) + self.tcx.sess.span_err_with_code( + span, + msg.to_string(), + DiagnosticId::Error(String::from("creusot")), + ) } pub(crate) fn warn(&self, span: Span, msg: &str) { self.tcx.sess.span_warn_with_code( span, - msg, + msg.to_string(), DiagnosticId::Lint { name: String::from("creusot"), has_future_breakage: false,