Skip to content

Commit

Permalink
cleanup: remove commented-out code
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhance committed Feb 27, 2025
1 parent fe04886 commit f24251c
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions source/rust_verify/src/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ impl<'a, 'tcx> VisitMod<'a, 'tcx> {
if eattrs.external {
VerifState::External
} else if opts_in_to_verus(&eattrs) {
//|| opts_in_by_automatic_derive(&self.ctxt, &general_item, &attrs) {
VerifState::Verify
} else {
VerifState::Default
Expand Down Expand Up @@ -554,54 +553,3 @@ impl<'a> GeneralItem<'a> {
}
}
}

/*
fn opts_in_by_automatic_derive<'tcx>(
ctxt: &Context<'tcx>,
general_item: &GeneralItem<'tcx>,
attrs: &[rustc_ast::Attribute],
) -> bool {
if is_automatically_derived(attrs) {
match general_item {
GeneralItem::Item(item) => match &item.kind {
ItemKind::Impl(impll) => {
let def_id = match impll.self_ty.kind {
rustc_hir::TyKind::Path(rustc_hir::QPath::Resolved(None, path)) => path.res.def_id(),
_ => { return false; }
};
if let Some(local_def_id) = def_id.as_local() {
let hir_id = ctxt.tcx.local_def_id_to_hir_id(local_def_id);
let attrs = ctxt.tcx.hir().attrs(hir_id);
let eattrs = match ctxt.get_external_attrs(attrs) {
Ok(eattrs) => eattrs,
Err(_) => { return false; }
};
opts_in_to_verus(&eattrs)
} else {
false
}
}
_ => false,
}
_ => false,
}
} else {
false
}
}
fn is_automatically_derived(attrs: &[rustc_ast::Attribute]) -> bool {
for attr in attrs.iter() {
match &attr.kind {
rustc_ast::AttrKind::Normal(item) => match &item.item.path.segments[..] {
[segment] => if segment.ident.as_str() == "automatically_derived" {
return true;
}
_ => { }
}
_ => { }
}
}
false
}
*/

0 comments on commit f24251c

Please sign in to comment.