Skip to content

std: Remove fortune cookies from fatal runtime errors #20944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

brson
Copy link
Contributor

@brson brson commented Jan 11, 2015

Closes #13871

@rust-highfive
Copy link
Contributor

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@brson brson mentioned this pull request Jan 11, 2015
@jfager
Copy link
Contributor

jfager commented Jan 11, 2015

Boooooo. (edit: In eulogy: one of the first things I worked on w/ Rust was the Matasano crypto challenges. I spent a lot of time fighting the compiler trying to learn the basics, get past the borrow checker, and work through the occasional ice, but for the most part made pretty decent progress. I finally did something that managed to get a Lovecraft quote, but it took me maybe a good 5 minutes to realize that it was a runtime error and not a sudden shift in theme in the challenge answers. Might have been my first <3 Rust moment.)

@Gankra
Copy link
Contributor

Gankra commented Jan 11, 2015

Instantly r+'d by the PR author... this kind of totalitarian management of the project won't stand!

😈

@MattWindsor91
Copy link
Contributor

I'll always remember coming back to an attempt to compile rustc, seeing You've met with a terrible fate, haven't you? and being a mixture of annoyed, confused, and (I'll admit) slightly amused xD

@csouth3
Copy link
Contributor

csouth3 commented Jan 11, 2015

😢 rip. I only got a Lovecraft quote once ever, but it was pretty much my favorite Rust moment ever.

@@ -144,56 +144,6 @@ pub fn abort(args: fmt::Arguments) -> ! {
let _ = write!(&mut w, "{}", args);
let msg = str::from_utf8(&w.buf[0..w.pos]).unwrap_or("aborted");
let msg = if msg.is_empty() {"aborted"} else {msg};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this logic is not necessary anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddyb It seems to cover real cases: the first if the buffer is not utf8 (though with fmt changing to require utf8 maybe that's impossible), and the second if the abor t message is empty. Neither of those seem to be related to the easter egg.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant the whole writing to a buffer thing. That was only done for the fortune hash. Can just write the format args to stderr now.

@tshepang
Copy link
Member

@gankro I was surprised that @bors allows changes to be approved by their authors.

@retep998
Copy link
Member

I'm against this change. If anything we should be encrypting the text so that they are truly Easter eggs.

bors added a commit that referenced this pull request Jan 13, 2015
@Gankra
Copy link
Contributor

Gankra commented Jan 13, 2015

@tshepang: bors also allows r=litterallyAnything; it is not built to have any particular security model other than "I listen to those with authority".

@bors bors merged commit 740c837 into rust-lang:master Jan 13, 2015
@stuartpb
Copy link

👏 👍 👏

@alexchandel
Copy link

Why couldn't we just remove the text for non-debug builds?

@lilyball
Copy link
Contributor

I sympathize with the "2k is significant on some platforms" argument, but I am rather saddened to see this go.

I do wish it could exist only for non-debug builds. Though offhand I'm not sure how that would be possible. I'm also confused as to how this was ending up in #![no_std] builds since it apparently was part of libstd/rt/util.rs, which one would think is only present in libstd.

@liigo
Copy link
Contributor

liigo commented Jan 15, 2015

Nice to see useless code gone!

@monperrus
Copy link

FTR, this PR is mentioned in Long Live Software Easter Eggs (ACM Queue, 2022)

"be careful, this battle is epic and dangerous. H.P. Lovecraft was killed by a gunshot in the trenches of the Rust compiler."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"hello world" contains Lovecraft quotes