remove some unused code and types
This commit is contained in:
parent
ee3fc9dff8
commit
3e44ca95dd
2 changed files with 17 additions and 69 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
use crate::mir::{Body, ConstantKind, Promoted};
|
||||
use crate::ty::{self, OpaqueHiddenType, Ty, TyCtxt};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_data_structures::vec_map::VecMap;
|
||||
use rustc_errors::ErrorGuaranteed;
|
||||
use rustc_hir as hir;
|
||||
|
@ -115,21 +115,6 @@ pub enum UnusedUnsafe {
|
|||
/// `unsafe` block nested under another (used) `unsafe` block
|
||||
/// > ``… because it's nested under this `unsafe` block``
|
||||
InUnsafeBlock(hir::HirId),
|
||||
/// `unsafe` block nested under `unsafe fn`
|
||||
/// > ``… because it's nested under this `unsafe fn` ``
|
||||
///
|
||||
/// the second HirId here indicates the first usage of the `unsafe` block,
|
||||
/// which allows retrieval of the LintLevelSource for why that operation would
|
||||
/// have been permitted without the block
|
||||
InUnsafeFn(hir::HirId, hir::HirId),
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, TyEncodable, TyDecodable, HashStable, Debug)]
|
||||
pub enum UsedUnsafeBlockData {
|
||||
SomeDisallowedInUnsafeFn,
|
||||
// the HirId here indicates the first usage of the `unsafe` block
|
||||
// (i.e. the one that's first encountered in the MIR traversal of the unsafety check)
|
||||
AllAllowedInUnsafeFn(hir::HirId),
|
||||
}
|
||||
|
||||
#[derive(TyEncodable, TyDecodable, HashStable, Debug)]
|
||||
|
@ -138,10 +123,7 @@ pub struct UnsafetyCheckResult {
|
|||
pub violations: Vec<UnsafetyViolation>,
|
||||
|
||||
/// Used `unsafe` blocks in this function. This is used for the "unused_unsafe" lint.
|
||||
///
|
||||
/// The keys are the used `unsafe` blocks, the UnusedUnsafeKind indicates whether
|
||||
/// or not any of the usages happen at a place that doesn't allow `unsafe_op_in_unsafe_fn`.
|
||||
pub used_unsafe_blocks: FxHashMap<hir::HirId, UsedUnsafeBlockData>,
|
||||
pub used_unsafe_blocks: FxHashSet<hir::HirId>,
|
||||
|
||||
/// This is `Some` iff the item is not a closure.
|
||||
pub unused_unsafes: Option<Vec<(hir::HirId, UnusedUnsafe)>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue