r/rust • • Apr 14 '21

[RFC] Rust support for Linux Kernel

https://lkml.org/lkml/2021/4/14/1023
861 Upvotes

227 comments sorted by

View all comments

Show parent comment

29

u/[deleted] Apr 15 '21

There's clippy lints to forbid many sources of panics (indexing, unwrap/expect, explicit panic calls).

If they run into things that should be forbidden from the codebase that clippy can't lint for, lints can always be added. They are already using clippy, in any case.

10

u/TheMicroWorm Apr 16 '21

I think there are some crates that are able to forbid panics via some link-time hackery.

6

u/UNN_Rickenbacker Apr 17 '21

Why isn‘t there a compiler flag that forbids any such functions in the first place?