Ignore AscribeUserType in unsafeck to avoid duplicate diagnostics.
This commit is contained in:
parent
4462bb54e3
commit
e107194b66
6 changed files with 17 additions and 33 deletions
|
@ -100,7 +100,6 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> {
|
|||
| StatementKind::StorageLive(..)
|
||||
| StatementKind::StorageDead(..)
|
||||
| StatementKind::Retag { .. }
|
||||
| StatementKind::AscribeUserType(..)
|
||||
| StatementKind::PlaceMention(..)
|
||||
| StatementKind::Coverage(..)
|
||||
| StatementKind::Intrinsic(..)
|
||||
|
@ -108,6 +107,9 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> {
|
|||
| StatementKind::Nop => {
|
||||
// safe (at least as emitted during MIR construction)
|
||||
}
|
||||
// `AscribeUserType` just exists to help MIR borrowck. It has no semantics, and
|
||||
// everything is already reported by `PlaceMention`.
|
||||
StatementKind::AscribeUserType(..) => return,
|
||||
}
|
||||
self.super_statement(statement, location);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue