]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_attr/src/session_diagnostics.rs
Rollup merge of #101100 - compiler-errors:generalize-call-suggestions, r=petrochenkov
[rust.git] / compiler / rustc_attr / src / session_diagnostics.rs
index a75e7409fba18ce9b1b6eb6fa9418095bc6d91da..25cd960dbf1d0c232298fd6fee6f052f68392987 100644 (file)
@@ -223,14 +223,12 @@ fn into_diagnostic(self, sess: &'a ParseSess) -> DiagnosticBuilder<'a, ErrorGuar
             error_code!(E0565),
         );
         if self.is_bytestr {
-            if let Ok(lint_str) = sess.source_map().span_to_snippet(self.span) {
-                diag.span_suggestion(
-                    self.span,
-                    fluent::attr::unsupported_literal_suggestion,
-                    &lint_str[1..],
-                    Applicability::MaybeIncorrect,
-                );
-            }
+            diag.span_suggestion(
+                sess.source_map().start_point(self.span),
+                fluent::attr::unsupported_literal_suggestion,
+                "",
+                Applicability::MaybeIncorrect,
+            );
         }
         diag
     }