Created
November 10, 2023 17:29
-
-
Save lennyerik/f1e095b13e3e5b0574391ec69e79a15f to your computer and use it in GitHub Desktop.
A patch for the Rust compiler (release 1.73.0) to throw insults at you with every suggestion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs | |
index 0cae06881b1..f9551bccde0 100644 | |
--- a/compiler/rustc_errors/src/emitter.rs | |
+++ b/compiler/rustc_errors/src/emitter.rs | |
@@ -262,11 +262,11 @@ pub trait Emitter: Translate { | |
let msg = if substitution.is_empty() || sugg.style.hide_inline() { | |
// This substitution is only removal OR we explicitly don't want to show the | |
// code inline (`hide_inline`). Therefore, we don't show the substitution. | |
- format!("help: {msg}") | |
+ format!("help: {msg}, you idiot") | |
} else { | |
// Show the default suggestion text with the substitution | |
format!( | |
- "help: {}{}: `{}`", | |
+ "help: {}{}, you moron: `{}`", | |
msg, | |
if self.source_map().is_some_and(|sm| is_case_difference( | |
sm, | |
@@ -1743,6 +1743,8 @@ impl EmitterWriter { | |
Some(Style::HeaderMsg), | |
); | |
+ buffer.append(0, ", moron", Style::NoStyle); | |
+ | |
let mut row_num = 2; | |
draw_col_separator_no_space(&mut buffer, 1, max_line_num_len + 1); | |
let mut notice_capitalization = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment