Skip to content

Commit e41b8f2

Browse files
committed
remove attr id from rustc_attr_parsing::AcceptContext
1 parent f1543ae commit e41b8f2

5 files changed

Lines changed: 3 additions & 15 deletions

File tree

compiler/rustc_attr_parsing/src/attributes/lint.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use rustc_ast::LitKind;
2-
use rustc_hir::HashIgnoredAttrId;
32
use rustc_hir::attrs::{LintAttribute, LintAttributeKind, LintInstance};
43
use rustc_hir::lints::AttributeLintKind;
54
use rustc_hir::target::GenericParamKind;
@@ -251,7 +250,6 @@ fn validate_lint_attr<T: Lint, S: Stage>(
251250
lint_instances,
252251
attr_span: cx.attr_span,
253252
attr_style: cx.attr_style,
254-
attr_id: HashIgnoredAttrId { attr_id: cx.attr_id },
255253
target_span: cx.target_span,
256254
kind: T::KIND,
257255
})

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_hir::{AttrPath, HirId};
1515
use rustc_parse::parser::Recovery;
1616
use rustc_session::Session;
1717
use rustc_session::lint::{Lint, LintId};
18-
use rustc_span::{AttrId, ErrorGuaranteed, Span, Symbol};
18+
use rustc_span::{ErrorGuaranteed, Span, Symbol};
1919

2020
use crate::AttributeParser;
2121
// Glob imports to avoid big, bitrotty import lists
@@ -447,8 +447,6 @@ pub struct AcceptContext<'f, 'sess, S: Stage> {
447447

448448
/// The name of the attribute we're currently accepting.
449449
pub(crate) attr_path: AttrPath,
450-
451-
pub(crate) attr_id: AttrId,
452450
}
453451

454452
impl<'f, 'sess: 'f, S: Stage> SharedContext<'f, 'sess, S> {

compiler/rustc_attr_parsing/src/interface.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ impl<'sess> AttributeParser<'sess, Early> {
240240
if let Some(safety) = attr_safety {
241241
parser.check_attribute_safety(&attr_path, inner_span, safety, &mut emit_lint)
242242
}
243-
let attr_id = sess.psess.attr_id_generator.mk_attr_id();
244243
let mut cx: AcceptContext<'_, 'sess, Early> = AcceptContext {
245244
shared: SharedContext {
246245
cx: &mut parser,
@@ -254,7 +253,6 @@ impl<'sess> AttributeParser<'sess, Early> {
254253
parsed_description,
255254
template,
256255
attr_path,
257-
attr_id,
258256
};
259257
parse_fn(&mut cx, args)
260258
}
@@ -420,7 +418,6 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> {
420418
parsed_description: ParsedDescription::Attribute,
421419
template: &accept.template,
422420
attr_path: attr_path.clone(),
423-
attr_id: attr.id,
424421
};
425422

426423
(accept.accept_fn)(&mut cx, &args);

compiler/rustc_hir/src/attrs/data_structures.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ use thin_vec::ThinVec;
2222
use crate::attrs::diagnostic::*;
2323
use crate::attrs::pretty_printing::PrintAttribute;
2424
use crate::limit::Limit;
25-
use crate::{
26-
DefaultBodyStability, HashIgnoredAttrId, PartialConstStability, RustcVersion, Stability,
27-
};
25+
use crate::{DefaultBodyStability, PartialConstStability, RustcVersion, Stability};
2826

2927
#[derive(Copy, Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)]
3028
pub enum EiiImplResolution {
@@ -904,8 +902,6 @@ pub struct LintAttribute {
904902
pub attr_style: AttrStyle,
905903
pub attr_span: Span,
906904
pub target_span: Span,
907-
/// Needed by `LintExpectationId` to track fulfilled expectations
908-
pub attr_id: HashIgnoredAttrId,
909905
pub lint_instances: ThinVec<LintInstance>,
910906
}
911907

compiler/rustc_lint_defs/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ use rustc_data_structures::stable_hasher::{
99
use rustc_error_messages::{DiagArgValue, IntoDiagArg};
1010
use rustc_hir_id::{HirId, ItemLocalId};
1111
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
12-
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
1312
use rustc_span::def_id::DefPathHash;
1413
pub use rustc_span::edition::Edition;
15-
use rustc_span::{HashStableContext, Ident, Span, SpanDecoder, SpanEncoder, Symbol, sym};
14+
use rustc_span::{HashStableContext, Ident, Span, Symbol, sym};
1615
use serde::{Deserialize, Serialize};
1716

1817
pub use self::Level::*;

0 commit comments

Comments
 (0)