summaryrefslogtreecommitdiff
path: root/Undefined behaviour is caught by the compiler.md
blob: 62adbff9d9cb54fe20eaa973b922205d8056da9c (plain)
1
2
3
4
5
6
7
8
9
10
[[Rust]]
[[What is a segmentation fault]]

Undefined behaviour is prevented by compiler checks. For example we can't use an undefined variable in a function call. If that were unchecked it's behaviour is undefined:
- it could cause a segvault
- it could cause no harm
- it could become the target of a hack

A list of behaviours considered undefined:
https://doc.rust-lang.org/reference/behavior-considered-undefined.html