Exclude Rvalue::AddressOf for raw pointer deref alignment checks
This commit is contained in:
parent
de4dddf155
commit
783b1ce99c
1 changed files with 8 additions and 0 deletions
|
@ -75,6 +75,14 @@ struct PointerFinder<'tcx, 'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx, 'a> Visitor<'tcx> for PointerFinder<'tcx, 'a> {
|
impl<'tcx, 'a> Visitor<'tcx> for PointerFinder<'tcx, 'a> {
|
||||||
|
fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
|
||||||
|
if let Rvalue::AddressOf(..) = rvalue {
|
||||||
|
// Ignore dereferences inside of an AddressOf
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.super_rvalue(rvalue, location);
|
||||||
|
}
|
||||||
|
|
||||||
fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location: Location) {
|
fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location: Location) {
|
||||||
if let PlaceContext::NonUse(_) = context {
|
if let PlaceContext::NonUse(_) = context {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue