diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-04-26 10:43:00 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-04-26 14:49:28 +0000 |
| commit | 3568bdc6cdf04da3bf8f1be02741ea731265a3da (patch) | |
| tree | f0b01b7b7588baf7c0cf525b12a77525d4113e53 /compiler/rustc_mir_transform/src | |
| parent | 1c988cfa0b7f4d3bc5b1cb40dc5002f5adbfb9ad (diff) | |
| download | rust-3568bdc6cdf04da3bf8f1be02741ea731265a3da.tar.gz rust-3568bdc6cdf04da3bf8f1be02741ea731265a3da.zip | |
Revert "add `DefId` to unsafety violations and display function path in E0133"
This reverts commit 8b8f6653cfd54525714f02efe7af0a0f830e185c.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/check_unsafety.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/check_unsafety.rs b/compiler/rustc_mir_transform/src/check_unsafety.rs index 34093eb29eb..dde79214b16 100644 --- a/compiler/rustc_mir_transform/src/check_unsafety.rs +++ b/compiler/rustc_mir_transform/src/check_unsafety.rs @@ -76,7 +76,7 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> { if let hir::Unsafety::Unsafe = sig.unsafety() { self.require_unsafe( UnsafetyViolationKind::General, - UnsafetyViolationDetails::CallToUnsafeFunction(func_id.copied()), + UnsafetyViolationDetails::CallToUnsafeFunction, ) } @@ -381,7 +381,7 @@ impl<'tcx> UnsafetyChecker<'_, 'tcx> { if !callee_features.iter().all(|feature| self_features.contains(feature)) { self.require_unsafe( UnsafetyViolationKind::General, - UnsafetyViolationDetails::CallToFunctionWith(func_did), + UnsafetyViolationDetails::CallToFunctionWith, ) } } @@ -580,8 +580,7 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: LocalDefId) { let UnsafetyCheckResult { violations, unused_unsafes, .. } = tcx.unsafety_check_result(def_id); for &UnsafetyViolation { source_info, lint_root, kind, details } in violations.iter() { - let (description, note) = - ty::print::with_no_trimmed_paths!(details.description_and_note(tcx)); + let (description, note) = details.description_and_note(); // Report an error. let unsafe_fn_msg = @@ -598,7 +597,7 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: LocalDefId) { description, unsafe_fn_msg, ) - .span_label(source_info.span, details.simple_description()) + .span_label(source_info.span, description) .note(note) .emit(); } |
