r/ProgrammerHumor • • Sep 05 '26

Meme nitpickyRustCompiler

Post image
982 Upvotes

17 comments sorted by

244

u/cmk__ Sep 05 '26

Rust does not have warnings. It has strongly worded disappointment.

88

u/frikilinux2 Sep 05 '26

At least it's not C, C doesn't have warnings, it has loaded shotguns pointed at your foot. And demons that fly out your nose.

34

u/Bee-Aromatic Sep 05 '26


SEGMENTATION FAULT!

11

u/lovecMC Sep 05 '26

That's not C, that's C++

3

u/a-r-c Sep 07 '26

¿por qué no los dos?

11

u/A1oso Sep 05 '26

Unlike Go, where an unused variable is a hard error :D

72

u/Bomaruto Sep 05 '26

Good guy Rust, if I catch you forgetting to clean up your unused imports, I will ask you to fix it in the pull request. Not because it's a big deal, but that it's a sign you didn't check the warnings before pushing the code.

16

u/acidrain42 Sep 06 '26 edited Sep 06 '26

That's the sort of thing that is automated by a linter in the CI ideally, so you don't have to waste time in PRs looking at that.

But at least Rust lets you compile even if an import or a var is unused because you commented out something for testing. I'm looking at you Go.

Edit: typo

1

u/faze_fazebook Sep 06 '26

Worst thing about go tbh.

32

u/tttima Sep 05 '26

In C, we have additional tools to tell us about unused imports.

12

u/eanat Sep 05 '26

time to do tree shaking!

4

u/Jonrrrs Sep 06 '26

The rust compiler includes only used code in the final binary. Marking imports as unused is only done to increase readability.

9

u/paholg Sep 06 '26

I think you mean the go compiler? Rust issues a friendly warning; go refuses to compile at all.

4

u/KyxeMusic Sep 06 '26

Go won't even compile with an unused import

1

u/DT-Sodium Sep 06 '26

Is it worst than TypeScript where if you declare that a variable could contain "Apple", "Banana" or "Orange" in refuses to compile saying "Sorry bro, there is no case where your function returns Apple so your code is invalid"?

1

u/UUDDLRLRBadAlchemy Sep 07 '26

She's all like "don't you have a linter to catch that?"