about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-02-13 11:34:57 +0100
committerGitHub <noreply@github.com>2023-02-13 11:34:57 +0100
commitb3077fbc090049d9ac3c6299e5e3c08da09f2e08 (patch)
tree29b58dbb79f4ef69ed03490963ce5b4358c4d25e
parent863e96d62654e8919dfab9890f74ca67e8ab682e (diff)
parent374c393a937318b2ab6620010a0d252d1339383c (diff)
downloadrust-b3077fbc090049d9ac3c6299e5e3c08da09f2e08.tar.gz
rust-b3077fbc090049d9ac3c6299e5e3c08da09f2e08.zip
Rollup merge of #107838 - estebank:terminal_hyperlinks, r=nagisa
Introduce `-Zterminal-urls` to use OSC8 for error codes

Terminals supporting the OSC8 Hyperlink Extension can support inline anchors where the text is user defineable but clicking on it opens a browser to a specified URLs, just like `<a href="URL">` does in HTML.

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
-rw-r--r--clippy_lints/src/doc.rs3
-rw-r--r--src/driver.rs1
2 files changed, 3 insertions, 1 deletions
diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs
index 127201b72e2..0b31e20fc87 100644
--- a/clippy_lints/src/doc.rs
+++ b/clippy_lints/src/doc.rs
@@ -11,7 +11,7 @@ use rustc_ast::token::CommentKind;
 use rustc_data_structures::fx::FxHashSet;
 use rustc_data_structures::sync::Lrc;
 use rustc_errors::emitter::EmitterWriter;
-use rustc_errors::{Applicability, Handler, SuggestionStyle};
+use rustc_errors::{Applicability, Handler, SuggestionStyle, TerminalUrl};
 use rustc_hir as hir;
 use rustc_hir::intravisit::{self, Visitor};
 use rustc_hir::{AnonConst, Expr};
@@ -717,6 +717,7 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) {
                     None,
                     false,
                     false,
+                    TerminalUrl::No,
                 );
                 let handler = Handler::with_emitter(false, None, Box::new(emitter));
                 let sess = ParseSess::with_span_handler(handler, sm);
diff --git a/src/driver.rs b/src/driver.rs
index d521e8d8839..e45835efe74 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -220,6 +220,7 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
         None,
         false,
         false,
+        rustc_errors::TerminalUrl::No,
     ));
     let handler = rustc_errors::Handler::with_emitter(true, None, emitter);