Skip to content

Commit a3bae5c

Browse files
Fix wrong conflict resolution
1 parent a41f763 commit a3bae5c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/librustc_mir/transform/check_unsafety.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,12 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
204204

205205
if context.is_borrow() {
206206
if util::is_disaligned(self.tcx, self.body, self.param_env, *place) {
207-
let source_info = self.source_info;
208-
let lint_root = self.body.source_scopes[source_info.scope]
209-
.local_data
210-
.as_ref()
211-
.assert_crate_local()
212-
.lint_root;
213207
self.require_unsafe(
214208
"borrow of packed field",
215209
"fields of packed structs might be misaligned: dereferencing a \
216210
misaligned pointer or even just creating a misaligned reference \
217211
is undefined behavior",
218-
UnsafetyViolationKind::BorrowPacked(lint_root),
212+
UnsafetyViolationKind::BorrowPacked,
219213
);
220214
}
221215
}

0 commit comments

Comments
 (0)