diff --git a/src/doc/rustc-dev-guide/src/unsafety-checking.md b/src/doc/rustc-dev-guide/src/unsafety-checking.md index d1a3ddb13850..fcdd4a8236b5 100644 --- a/src/doc/rustc-dev-guide/src/unsafety-checking.md +++ b/src/doc/rustc-dev-guide/src/unsafety-checking.md @@ -19,8 +19,8 @@ THIR is chosen because there are fewer cases to consider than in HIR, for example unsafe function calls and unsafe method calls have the same representation in THIR. The check is not done on MIR because safety checks do not depend on control flow, -so MIR is not necessary to use, -and MIR doesn't have as precise spans for some expressions. +so there is no need to use MIR. +Also, MIR doesn't have precise enough spans for some expressions. Most unsafe operations can be identified by checking the `ExprKind` in THIR and checking the type of the argument.