Add find_map_relevant_impl
This commit is contained in:
parent
2359ecc71f
commit
7993ddd89d
7 changed files with 51 additions and 27 deletions
|
@ -34,7 +34,6 @@ impl<'a, 'tcx> ConstMutationChecker<'a, 'tcx> {
|
|||
|
||||
fn is_const_item_without_destructor(&self, local: Local) -> Option<DefId> {
|
||||
let def_id = self.is_const_item(local)?;
|
||||
let mut any_dtor = |_tcx, _def_id| Ok(());
|
||||
|
||||
// We avoid linting mutation of a const item if the const's type has a
|
||||
// Drop impl. The Drop logic observes the mutation which was performed.
|
||||
|
@ -54,7 +53,7 @@ impl<'a, 'tcx> ConstMutationChecker<'a, 'tcx> {
|
|||
//
|
||||
// #[const_mutation_allowed]
|
||||
// pub const LOG: Log = Log { msg: "" };
|
||||
match self.tcx.calculate_dtor(def_id, &mut any_dtor) {
|
||||
match self.tcx.calculate_dtor(def_id, |_, _| Ok(())) {
|
||||
Some(_) => None,
|
||||
None => Some(def_id),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue