Fix unused_unsafe with compiler-generated unsafe

This commit is contained in:
Cameron Steffen 2021-04-29 20:54:22 -05:00
parent 39260f6d49
commit b07bb6d698
9 changed files with 43 additions and 25 deletions

View file

@ -494,6 +494,8 @@ impl<'tcx> Body<'tcx> {
#[derive(Copy, Clone, PartialEq, Eq, Debug, TyEncodable, TyDecodable, HashStable)]
pub enum Safety {
Safe,
/// Unsafe because of compiler-generated unsafe code, like `await` desugaring
BuiltinUnsafe,
/// Unsafe because of an unsafe fn
FnUnsafe,
/// Unsafe because of an `unsafe` block