Skip to content

Commit f3e6d88

Browse files
committed
Fix typos and replace static vector with slice
1 parent 2eb4fc8 commit f3e6d88

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

compiler/rustc_incremental/src/persist/dirty_clean.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub fn check_dirty_clean_annotations(tcx: TyCtxt<'_>) {
160160

161161
let mut all_attrs = FindAllAttrs {
162162
tcx,
163-
attr_names: vec![sym::rustc_dirty, sym::rustc_clean],
163+
attr_names: &[sym::rustc_dirty, sym::rustc_clean],
164164
found_attrs: vec![],
165165
};
166166
intravisit::walk_crate(&mut all_attrs, krate);
@@ -299,7 +299,7 @@ impl DirtyCleanVisitor<'tcx> {
299299

300300
// Represents a Trait Declaration
301301
// FIXME(michaelwoerister): trait declaration is buggy because sometimes some of
302-
// the depnodes don't exist (because they legitametely didn't need to be
302+
// the depnodes don't exist (because they legitimately didn't need to be
303303
// calculated)
304304
//
305305
// michaelwoerister and vitiral came up with a possible solution,
@@ -512,17 +512,17 @@ fn expect_associated_value(tcx: TyCtxt<'_>, item: &NestedMetaItem) -> Symbol {
512512
}
513513

514514
// A visitor that collects all #[rustc_dirty]/#[rustc_clean] attributes from
515-
// the HIR. It is used to verfiy that we really ran checks for all annotated
515+
// the HIR. It is used to verify that we really ran checks for all annotated
516516
// nodes.
517-
pub struct FindAllAttrs<'tcx> {
517+
pub struct FindAllAttrs<'a, 'tcx> {
518518
tcx: TyCtxt<'tcx>,
519-
attr_names: Vec<Symbol>,
519+
attr_names: &'a [Symbol],
520520
found_attrs: Vec<&'tcx Attribute>,
521521
}
522522

523-
impl FindAllAttrs<'tcx> {
523+
impl FindAllAttrs<'_, 'tcx> {
524524
fn is_active_attr(&mut self, attr: &Attribute) -> bool {
525-
for attr_name in &self.attr_names {
525+
for attr_name in self.attr_names {
526526
if self.tcx.sess.check_name(attr, *attr_name) && check_config(self.tcx, attr) {
527527
return true;
528528
}
@@ -543,7 +543,7 @@ impl FindAllAttrs<'tcx> {
543543
}
544544
}
545545

546-
impl intravisit::Visitor<'tcx> for FindAllAttrs<'tcx> {
546+
impl intravisit::Visitor<'tcx> for FindAllAttrs<'_, 'tcx> {
547547
type Map = Map<'tcx>;
548548

549549
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {

0 commit comments

Comments
 (0)